PROGRAMMING:Graphic card sorting game
Master class inheritance, polymorphism usage and interface application. See the operation instruction for details
[2020-oo 7th operation-1 instruction v1.0. PDF] (~ / f52db597-70a8-4cf0-8e8c-5caf8f081cfd. PDF)
###Input format:
*First, enter a series of numbers (1 ~ 4, integers) on a line, where 1 represents a circular card, 2 represents a rectangular card, 3 represents a triangular card, and 4 represents a trapezoidal card. The numbers are separated by one or more spaces, ending with "0". For example:
`1 3 4 2 1 3 4 2 1 3 0`
*Then, according to the card graphic type represented by the first line of numbers, input the relevant parameters of each graphic in turn. For example, for circular cards, the radius of the circle needs to be input, for rectangular cards, the width and length of the rectangle need to be input, for triangular cards, the lengths of the three sides of the triangle need to be input, and for trapezoid cards, the upper bottom, lower bottom and height of the trapezoid need to be input. The data is separated by one or more spaces.
###Output format:
*If the number of graphics is illegal (less than 0) or the graphics attribute value is illegal (the value is less than 0 and the three sides of the triangle cannot form a triangle), output 'wrong format'.
*If the input is legal, the output will be normal, and the two decimal places will be reserved after all numerical calculation. The output is as follows:
1. The format of each graphic type and area before sorting is' graphic name 1: area value 1 graphic name 2: area value 2... Graphic name n: area value n '. Note that each graphic output is separated by a space, and there is a space for separation at the end of the output;
1. The type, area and format of each figure after sorting are the same as those before sorting;
1. The total area of all figures in the format of 'sum of area: total area'.
###Input sample 1:
Here is a set of inputs. For example:
```in
1 5 3 2 0
```
###Output sample 1:
The corresponding output is given here. For example:
```out
Wrong Format
```
###Input sample 2:
Here is a set of inputs. For example:
```in
4 2 1 3 0
3.2 2.5 0.4 2.3 1.4 5.6 2.3 4.2 3.5
```
###Output sample 2:
The corresponding output is given here. For example:
```out
The original list:
T rapezoid:1.14 Rectangle :3.22 C ircle:98.52 Triangle :4.02
The sorted list:
C ircle:98.52 Triangle :4.02 R ectangle:3.22 Trapezoid :1.14
Sum of area:106.91
```
###Input sample 3:
Here is a set of inputs. For example:
```in
4 2 1 3 0
3.2 2.5 0.4 2.3 1.4 5.6 2.3 4.2 8.4
```
###Output sample 3:
The corresponding output is given here. For example:
```out
Wrong Format
```
answer:If there is no answer, please comment
1. The application of inheritance and polymorphism;
1. The application of ArrayList < T > generics
1. Application of compatible < T > interface and generics
1. Application of the principle of single responsibility
1. Application of "open close" principle
[2020-oo 7th operation-1 instruction v1.0. PDF] (~ / f52db597-70a8-4cf0-8e8c-5caf8f081cfd. PDF)
###Input format:
*First, enter a series of numbers (1 ~ 4, integers) on a line, where 1 represents a circular card, 2 represents a rectangular card, 3 represents a triangular card, and 4 represents a trapezoidal card. The numbers are separated by one or more spaces, ending with "0". For example:
`1 3 4 2 1 3 4 2 1 3 0`
*Then, according to the card graphic type represented by the first line of numbers, input the relevant parameters of each graphic in turn. For example, for circular cards, the radius of the circle needs to be input, for rectangular cards, the width and length of the rectangle need to be input, for triangular cards, the lengths of the three sides of the triangle need to be input, and for trapezoid cards, the upper bottom, lower bottom and height of the trapezoid need to be input. The data is separated by one or more spaces.
###Output format:
*If the number of graphics is illegal (less than 0) or the graphics attribute value is illegal (the value is less than 0 and the three sides of the triangle cannot form a triangle), output 'wrong format'.
*If the input is legal, the output will be normal, and the two decimal places will be reserved after all numerical calculation. The output is as follows:
1. The format of each graphic type and area before sorting is' graphic name 1: area value 1 graphic name 2: area value 2... Graphic name n: area value n '. Note that each graphic output is separated by a space, and there is a space for separation at the end of the output;
1. The type, area and format of each figure after sorting are the same as those before sorting;
1. The total area of all figures in the format of 'sum of area: total area'.
###Input sample 1:
Here is a set of inputs. For example:
```in
1 5 3 2 0
```
###Output sample 1:
The corresponding output is given here. For example:
```out
Wrong Format
```
###Input sample 2:
Here is a set of inputs. For example:
```in
4 2 1 3 0
3.2 2.5 0.4 2.3 1.4 5.6 2.3 4.2 3.5
```
###Output sample 2:
The corresponding output is given here. For example:
```out
The original list:
T rapezoid:1.14 Rectangle :3.22 C ircle:98.52 Triangle :4.02
The sorted list:
C ircle:98.52 Triangle :4.02 R ectangle:3.22 Trapezoid :1.14
Sum of area:106.91
```
###Input sample 3:
Here is a set of inputs. For example:
```in
4 2 1 3 0
3.2 2.5 0.4 2.3 1.4 5.6 2.3 4.2 8.4
```
###Output sample 3:
The corresponding output is given here. For example:
```out
Wrong Format
```
answer:If there is no answer, please comment
1. The application of inheritance and polymorphism;
1. The application of ArrayList < T > generics
1. Application of compatible < T > interface and generics
1. Application of the principle of single responsibility
1. Application of "open close" principle