Question: please answer the following in C++ Write a C++class named Cone that consists of TWO float attributes, radius and slantHeight, by answering the following questions:
Write a C++class named Cone that consists of TWO float attributes, radius and slantHeight, by answering the following questions: a) Implement the following constructors: - An empty and parameter-less constructor. ( 2 marks) - A constructor that accepts as parameters the radius and slantHeight attributes. (3 marks) b) Implement class functions that: - Allows a user to enter the code dimensions. ( 3 marks) - Calculate and return the volume of the cone [volume =h/3r2 ]. ( 3 marks) - Calculate and return the surface area of the cone (surface area =r(r+h2+r2). (3 marks) - Display all the information related to the cone namely the radius, slant height, volume, and surface area. (5 marks) c) Implement a "getter" and a "setter" for both attributes. (4 marks) d) Implement a main function that instantiates an instance of a Cone and then asks a user to input the required dimensions. The program should then display all the information related to the sphere on the screen by invoking the appropriate functions
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
