Consider the following class definition. class circleType { public: void set(dou
ID: 1825396 • Letter: C
Question
Consider the following class definition. class circleType { public: void set(double r); //Postcondition: radius = r; void print(); //Output radius, area, and circumference. double area(); //Postcondition: Calculate and return area. double circumference(); //Postcondition: Calculate and return circumference. circleType(); //Postcondition: radius = 0; circleType(double r); //Postcondition: radius = r; private: double radius; }; and the declaration circleType myCircle; double r; Which of the following statements are valid in C++? (i) cin >> r; myCircle.area = 3.14 * r * r; cout (ii) cin >> r; myCircle.set(r); cout (Points : 5) Only (i) Only (ii) Both (i) and (ii) None of theseExplanation / Answer
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.