Classes define a Circle (Circle), the radius attribute (radius), circumference and area of operation for the input radius and calculate the perimeter, area, output radius, pupil, requirements definition constructor (with radius parameters, pupil in the constructor generated), and all the member functions in the test class #include using namespace std; The class Circle { Private: float radius, circum, area; Public: Circle (radius, float); }; Circle: : Circle (float raidus) {circum=2 * 3.14 * radius; Radius, area=3.14 * * radius; cout <"The radius=" & lt; Cout<& lt;" Circum="& lt; Cout<& lt;" Area="& lt; } Int main () { Float the radius; cout <"Both please enter the radius:" & lt; cin> The radius. Circle circle1 (radius); return 0; }
CodePudding user response:
Dizzy, parameters and members of the same name, use this to distinguish, namely This - & gt; The radius=raidus;//add here Circum=2 * 3.14 * radius;//in front of it with the code above