-->
当前位置:首页 > 题库

PROGRAMMING:Print point, circle and cylinder information

Luz5年前 (2021-05-10)题库392
Define the planar two-dimensional point class CPoint, including data member X coordinate, y coordinate, function member (constructor, virtual function for area getarea, virtual function for volume function getvolume, output point information function print).
CPoint class derived from the cirle class (new data member radius), function members (constructor, getarea, virtual function volume function getvolume, output circle area information function print).
Then the cylinder ccylinder class (height of new data member), function members (constructor, getarea, getvolume, print) are derived from the ccirle class. Test the three classes in the main function.
Print data to 2 decimal places
###Input format:
Point: X coordinate
Y coordinate of point
Radius of circle
Cylinder height
###Output format:
Point information
Circle area
Cylinder volume
###Input example:
Here is a set of inputs. For example:
```in
one
two
three
four
```
###Output example:
The corresponding output is given here. For example:
```out
CP oint:1 ,2
CirleA rea:28.26
CcylinderV olume:113.04
```







answer:If there is no answer, please comment