Question: Can you complete the program as specified, you will need to create three classes: Shape, Triangle, and Circle. The Triangle and Circle classes will inherit
Can you complete the program as specified, you will need to create three classes: Shape, Triangle, and Circle. The Triangle and Circle classes will inherit from the Shape class. The Triangle class will contain private member variables for the three sides of the triangle, and have a default constructor and another constructor that takes three integers for the side lengths. It will also have public methods for getting and setting the side lengths, as well as calculating the area and perimeter of the triangle. The Circle class will contain private member variables for the radius, fill color, and border color of the circle, and have a default constructor and another constructor that takes an integer for the radius and two strings for the fill and border colors. It will also have public methods for getting and setting the radius, fill color, and border color, as well as calculating the area and perimeter of the circle. The Shape class will contain member variables for the shape type, number of sides, fill color, and border color, and will have a default constructor that sets default values for these member variables. The Shape class will also have public methods for getting and setting the fill color and border color, and will have virtual methods for calculating the area and perimeter of the shape. The derived Triangle and Circle classes will override these methods to provide specific calculations for their shapes. In the Shape class, the SetShapeType and SetNumSides methods will be protected, allowing the derived classes to set these values in their constructors but preventing the user code from changing them. Your code should be written in two .cpp files and two .h files for each of the three classes, for a total of 6 files. You will also write a test driver to exercise and test these classes, but you will not submit the test driver to me.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
