# # # Circle class structure elucidation:
Circle class data members include:
(1) the static data constant PI (double), the value of 3.1415
(2) the private data members: radius radius (double),
Circle a class member function include:
(1) definition and constructor Circle (double) and copy constructor Circle (Circle & amp;) , including the Constructor parameters default value is 0, the output information "Constructor run", the copy Constructor output information "CopyConstructor run"
(2) define the Destructor, the Destructor output information "Destructor run"
(3) members of the public function: void setRadius (double) and double getRadius () returns and set the radius
(4) define public member functions to double circumference () is used to calculate the circumference of the circle
5. Define public member functions to double area () is used to calculate the area of a circle
6 class defined Circle of friends function of double fCircle_L (Circle & amp; R) and double fCircle_S (Circle & amp; R), were used to calculate the circle r pupil,
The referee sample testing program:
# include
using namespace std;
Please fill in the answer here */*/
Int main (void) {
Double r;
Cin & gt;> r;
Circle c1;
C1. SetRadius (r);
Cout & lt;
Cout & lt;
}
Input the sample:
1.0
The output sample:
The Constructor run
6.283
3.1415
CopyConstructor run
6.283
3.1415
Destructor run
Destructor run
CodePudding user response:
this classmate, homework have to do your own oh, there is no thinking went with classmates discuss..CodePudding user response: