In the previous exercise, you used the C++ visual development tools to extend the circle and sphere classes. In this exercise, you use the C++ visual development tools to add the cone class to the project. The cone class, which inherits from the shape3d class, calculates and displays the volume and surface area based on the radius and height of the cone. You can use the C++ visual development tools to add a class to the project, and to add an attribute to a class. To edit the body of the method, double-click the method in the diagram and edit the source code in the code editor.
Add the cone class to the Shapes project
You can add the class to the project by using the C/C++ Project Explorer view. You can identify any inheritance relationships by using the New C++/Class wizard.
To add the cone class to the Shapes project:
You have now added the cone class to the Shapes project. You can use the C++ visual development tools to add classes and attributes to the new class. Your diagram should look similar to the following figure:

To add the getColor and setColor methods to the cone class:
To add the getSize and setSize methods to the cone class:
To add the getRadius and setRadius methods:
To add the surfaceArea and volume methods to the cone class:
To add the set and print methods to the cone class:
To edit the cone.cpp file:
To run the application: