Question: Create a class Point with two data members x and y. Provide appropriate constructors, get, set and display methods. Derive a class Circle from Point.
Create a class Point with two data members x and y. Provide appropriate constructors, get, set and display methods.
Derive a class Circle from Point. The circle, in addition to the center (Point) also has radius as its data member. Provide constructors, get and set methods in the circle class. Also provide methods to compute area and circumference of the circle. (Area of circle is PI * r * r and Circumference is: 2 * PI * r).
Derive a class Cylinder from circle with a data member height. Provide constructors and set /get methods to set /get height of the cylinder. Provide a function to compute area of cylinder. (A = 2 x are of circle (base) + 2*PI* r*height). Also provide a function to compute the volume of cylinder (PI * r*r*h).
Derive a class sphere from circle. Provide a function to compute volume of sphere area of volume of sphere is. (A = 4/3 x PI *r*r*r).
Create an object of class Cylinder and compute its volume and surface area.
Step by Step Solution
3.47 Rating (157 Votes )
There are 3 Steps involved in it
Solution Source code Pointh pragma once include include using namespace std class point protected float x float y ... View full answer
Get step-by-step solutions from verified subject matter experts
