Question: C++ (Inheritance) Derive Cylinder from Circle Define first a class circleType: member variables: radius; member functions: setRadius, print, circumference, area, and constructor. Define a class

C++ (Inheritance)

Derive Cylinder from Circle

Define first a class circleType: member variables: radius; member functions: setRadius, print, circumference, area, and constructor.

Define a class cylinderType derived from circleType: member variables: height; member functions: setHeight, print, surface, volume, and construtor.

Write a program that tests both the circleType and cylinderType.

Input: The program first read in the radius of a circleType object, then read in the radius and height of a cylinderType object. e.g., 5 4 6

Output: the program shall test each member function of the circleType and cylinderType respectively. Define: const double PI = 3.14159

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!