Question: Problem 1: Create a class called Cylinder which contains the following: Three private instance variables of type double: Radius, Height, and Volume The following public

 Problem 1: Create a class called Cylinder which contains the following:

Problem 1: Create a class called Cylinder which contains the following: Three private instance variables of type double: Radius, Height, and Volume The following public functions: A default constructor with no argument that initialize the attributes in to default values 0.1, 0.1 for Radius, Height, and calculate the value of the initial volume. A constructor which takes one double argument for Radius and assume the value of Height =0.2 and calculates the value of the volume based on those values. A constructor which takes two double arguments for Radius and Height and calculates the value of the volume based on those values. Set function for radius and height attributes. Get function for radius and height attributes. Calculate volume: this function takes no argument and calculates the volume of the cylinder (v = 3.14.ph) GetVolume: returns the value of the volume. PrintInfo: print the information of the cylinder. NOTE: make sure any parameter passed to the functions has a positive value. Write a menu Driven program to test your class functions, with the following options: 1) Enter the Cylinder Radius and Height. 2) Print Cylinder info 3) Calculate & print volume 4) Exit

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!