Question: Chapter 10 defined the class circleType to implement the basic properties of a circle. (Add the function print to this class to output the radius,

Chapter 10 defined the class circleType to implement the basic properties ofChapter 10 defined the class circleType to implement the basic properties of a circle. (Add the function print to this class to output the radius, area, and circumference of a circle.) Now every cylinder has a base and height, where the base is a circle. Design a class cylinderType that can capture the properties of a cylinder and perform the usual operations on the cylinder. Derive this class from the class circleType designed in Chapter 10. Some of the operations that can be performed on a cylinder are as follows: calculate and print the volume, calculate and print the surface area, set the height, set the radius of the base, and set the center of the base. Also, write a program to test various operations on a cylinder.

Programming Exercise 11-3 Instructions Instructions circleType.h circleTypelmp.cpp cylinderType.h cylinderTypelmp.cppmain.cpp enu 3 #define circleType_A 4 #include iostream 5 #include 6 #include main.cpp: 10:5: erron s not declared in this scope cir' wa Chapter 10 defined the class circleType to implement the basic properties of a circle. (Add the function print to this class to output the radius, area, and circumference of a circle.) Now every cylinder has a base and height, where the base is a circle. Design a class cylinderType that can capture the properties of a cylinder and perform the usual operations on the cylinder. Derive this class from the class circleType designed in Chapter 10. Some of the operations that can be performed on a cylinder are as follows: calculate and print the volume, calculate and print the surface area, set the height, set the radius of the base, and set the center of the base. Also, write a program to test various operations on a cylinder print() > 7 #include "circleType.h" 8 using namespace std; 10 class circleType 12 public: main.cpp: 10:5: note: suggested A-T alternative: char cir.print() void print char main.cpp: 12:5: error rType' was not declared in thi s scope 14 15 void setRadius (double r); 16 17 18 19 0 double getRadius) 21 cylinde //Function to set the radius //Postcondition: if (r) radius-r cylinderTyp otherwise radus ; cyl (4, 9, 3. 5, 6.2); //Function to return the radius. //Postcondition: The value of radius is returned main.cpp:15:5: erron s not declared in this scope cyl' wa 23 24 double area) 25 26 27 28 double circumference) 29 cyl. print() //Function to return the area of a circle //Postcondition: Area is calculated and returned bash: line 2: /a.out: Grading file ort ory //Function to return the circumference of a circle

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 Databases Questions!