Question: Create a class called Point and implement with the following: class point { protected: double x, y; public: point() point(double n, double m) void setpoint(double
Create a class called Point and implement with the following:
class point
{
protected:
double x, y;
public:
point()
point(double n, double m)
void setpoint(double a, double b)
double getx()
double gety()
void print()
}
Write a class called Circle which inherits the Point class and implements it with the following:
class circle
public:
void print()
void setRadius(double);
double getRadius();
double area();
double circumference();
void setValues(double, double, double);
circle(double x, double y, double r);
protected:
double radius;
Write a class called Cylinder which inherits the Circle class and implements it with the following:
class cylinder
{
public:
void print()
void setHeight(double);
double getHeight();
void setValues(double, double, double, double);
double volume();
double area();
cylinder();
cylinder(double , double , double , double );
private:
double height;
Write test program and test the following:
Declare two cylinder objects C1 & C2, where C1 has default values and C2 has 10,12,5,8 as values. Print their informations
Change C1s values as 6, 4, 5, 5 and print it
Get as set of values from keyboard as 3 3 3 5 for C2 object, and print its information
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
