Question: Problem 1: Create a class called Right_Cone which have the following private attributes: r = radius h = height s = length of slant Double

Problem 1: Create a class called Right_Cone which have the following private attributes: r = radius h = height s = length of slant Double variable that contain the Radius of the Cone. Double variable that contain the Height of the Cone. For this class you must provide the following member Functions: A default constructor with no argument: that initialize the attributes in to default values 0.1, 0.1 for Radius, Height. A constructor which takes two double arguments for Radius and Height. . . Set Function that set all the Cone attribute. Get Function to get all the Cone attributes. Print Function to display the Cone attributes, volume, and slant height. Calculate Volume function that calculates and returns the Cone V = arh volume. . s=h2 + 72 Slant height function that calculates and returns the Length of the Slant of the Cone. 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 cone radius and height 2) Print the Cone info 3) Calculate the Cone volume 4) Calculate the Slant height 5) Exit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
