PROGRAMMING:Jmu-java-03 object oriented foundation-03-shape
##1. Define rectangle class and circle class
Rectangle class - * * class name: * * ` rectangle ', * * private attribute: * * ` int width, length`
Circular class - * * class name: * * ` circle ', * * private attribute: * * ` int radius`
**Write constructor:**
Parametric constructors: ` rectangle (width, length) ` circle (radius)`
**Writing method:**
`Public int getperimeter() ', find perimeter.
`Public int getarea() ', find the area.
`ToString 'method, generated automatically by eclipse.
**Note:**
1. Calculate the area and perimeter of the circle, using 'math. Pi'.
2. When calculating perimeter and area, you should first calculate their values (with decimal places), then convert them to 'Int' and return them.
##2. Main method
-Enter 2 length and width to create two rectangle objects and put them into the corresponding array.
-Enter 2 lines of radius, create two circle objects and put them into the corresponding array.
-Output 1: the * * perimeter * * sum of all objects in the above two arrays.
-Output 2: the * * area * * sum of all objects in the above two arrays.
-Finally, you need to use 'arrays. Deeptostring' to output the rectangle array and circle array created above respectively
**Thinking: * if you do this problem for the first time, you will find that the code redundancy is serious. Using inheritance and polymorphism can greatly simplify the above code.
###Input example:
```in
1 2
3 4
seven
one
```
###Output example:
```out
sixty-nine
one hundred and seventy
[Rectangle [width=1, length=2], Rectangle [width=3, length=4]]
[Circle [radius=7], Circle [radius=1]]
```
answer:If there is no answer, please comment
Rectangle class - * * class name: * * ` rectangle ', * * private attribute: * * ` int width, length`
Circular class - * * class name: * * ` circle ', * * private attribute: * * ` int radius`
**Write constructor:**
Parametric constructors: ` rectangle (width, length) ` circle (radius)`
**Writing method:**
`Public int getperimeter() ', find perimeter.
`Public int getarea() ', find the area.
`ToString 'method, generated automatically by eclipse.
**Note:**
1. Calculate the area and perimeter of the circle, using 'math. Pi'.
2. When calculating perimeter and area, you should first calculate their values (with decimal places), then convert them to 'Int' and return them.
##2. Main method
-Enter 2 length and width to create two rectangle objects and put them into the corresponding array.
-Enter 2 lines of radius, create two circle objects and put them into the corresponding array.
-Output 1: the * * perimeter * * sum of all objects in the above two arrays.
-Output 2: the * * area * * sum of all objects in the above two arrays.
-Finally, you need to use 'arrays. Deeptostring' to output the rectangle array and circle array created above respectively
**Thinking: * if you do this problem for the first time, you will find that the code redundancy is serious. Using inheritance and polymorphism can greatly simplify the above code.
###Input example:
```in
1 2
3 4
seven
one
```
###Output example:
```out
sixty-nine
one hundred and seventy
[Rectangle [width=1, length=2], Rectangle [width=3, length=4]]
[Circle [radius=7], Circle [radius=1]]
```
answer:If there is no answer, please comment