Question: Create a C + + Console Application that: Defines a Shape Class for geometric shapes. This will serve as a Base Class with fundamental Properties
Create a C Console Application that:
Defines a Shape Class for geometric shapes. This will serve as a Base Class with fundamental Properties and Methods:
Name for each shape object instantiated
Type of Shape rectangle triangle, or circle These can be Strings or Enums.
Color for each shape
Virtual Methods for computing the size perimeter of the shape as well as its area
Be sure to declare data items as private and provide public accessor methods for each data item
Define classes for Rectangle, Triangle, and Circle that each derive from that Shape Base Class
Provide appropriate data items to store values input by the User in each derived class for measurements eg height and width measurements for a rectangle object, three sides measurements for a triangle object, and radius for a circle object
Provide the appropriate methods in the derived classes to compute the appropriate values for perimeter and area use the basic geometric formulas
Be sure your program allows the User to input values type of shape, a name for it color, and appropriate dimensions for at least one object of each type rectangle triangle, and circle use your public accessor methods to populate those data items, and then display all of the values for each object including your derived size perimeter and area for each object.
Be sure your code is welldocumented with comments, and be sure to provide Input Validation eg parse to ensure User entered values are numeric for those data items that are numeric used in computations.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
