Question: Define a class called Circle with data members radius, area, and circumference. The class has the following member functions void set(double); void get(double&, double&,

Define a class called Circle with data members radius, area, and circumference. The class has the following

Define a class called Circle with data members radius, area, and circumference. The class has the following member functions void set(double); void get(double&, double&, double&) const; void calculate Circumference(); The function print prints the values of the components. The function calculate Area calculates the area of the circle using the formula p/ where r is the radius. The function calculateCircumference calculates the circumference of the circle using the formula 2 pr. ;void print() const :(void calculate Area Hint: To find the value of p use the formula 4* atan(1.0). The following driver produces the given sample of input/output: int main() Circle u; double r; cout < < "Enter the radius of the circle: "; cin >> r; u.set(r); u.print(); return 0; Sample Input/Output: Enter the radius of the circle: 3.5 The radius of the circle is: 3.5 The area of the circle is: 38.4845 The circumference of the circle is: 21.9911

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!