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 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