Home > Back-end >  Save me
Save me

Time:03-23

Define a class Circle Circle, the main () function to finish the test,

# # # 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; Circle the c2 (c1);
Cout & lt; Cout & lt; return 0;
}
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:

reference 1st floor SleekStone response:
this classmate, homework have to do your own oh, there is no thinking went with classmates discuss..

Students did not know

CodePudding user response:

reference # 2 floor cold plum accept reply:
Quote: refer to 1st floor SleekStone response:
this classmate, homework have to do your own oh, there is no thinking went with classmates discuss..

Students did not know
when elder brother so good cheat you, in fact you this is not difficult, to assemble books read a books under review can do, or have to practice more, really... Listen to me
  • Related