Question: C++ Global Constant Declare a global constant for PI using the value 3.14159 Class Circle Create a class called Circle with the following attributes and

C++

C++ Global Constant Declare a global constant for PI using the value

3.14159 Class Circle Create a class called Circle with the following attributes

Global Constant Declare a global constant for PI using the value 3.14159 Class Circle Create a class called Circle with the following attributes and operations: . A double called radius with protected accessibility A constructor with one parameter that wil initialize the radius A get accessor called getRadius() that returns the radius as a double. An operation called circumference() that calculates and returns the circumference of the circle as a double. The formula for circumference is 2 times PI times radius An operation called area() that calculates and returns the area of the circle as a double. The formula for area is PI times radius squared. . . Class Sphere Create a class called Sphere that inherits the attributes and operations o following operations for the Sphere class f the Circle class. Define the A constructor with one parameter for radius. Pass the radius to the Circle constructor using an initialization list. Refer to the section in Chapter 11 entitled "Passing Arguments to Base Class Constructors". . . An operation called volume0 that calculates and returns the volume of a sphere as a double. The formula for volume is four divided by 3 times PI times radius cubed . An operation called surfaceArea0 that calculates and returns the surface area of a sphere as a double. The formula is 4 times the area of a circle Class Cylinder Create a class called Cylinder that inherits the attributes and operations of the Circle class. Define the following attributes and o perations for the Cylinder class . A double called height with private accessibility . A constructor with a parameter for radius and another parameter for height. Using an initialization list, pass the radius to the Circle constructor and initialize the height. . An operation called surfaceArea0 that calculates and returns the surface area of a cylinder as a double. The formula is 2 times the area of a circle plus the circumference of a circle times the height An operation called volume that calculates and returns the volume of a cylinder as a double. The formula is the area of a circle times the height. . Main Function In the main, test the functionality of your classes. . Create a Circle object called lid with a radius of 5 . Create a Sphere object called globe using the radius of the lid. . Create a Cylinder object called cokeCan using the radius of the lid and a height of 10 .Display radius, height, surface area, and volume of cokeCan

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!