Can you please help me with this program for my C++ class? For this program, you
ID: 3825227 • Letter: C
Question
Can you please help me with this program for my C++ class?
For this program, you will implement the ShapeBuilder class.
The ShapeBuilder will ask the user what kind of shape he/she would like to build, and then ask for the appropriate dimensions of the shape.
For example, a circle will only need a radius and a rectangle will need a height and width.
Upon definition, the ShapeBuilder will display the shape to the screen. If the user likes what he/she sees, then they have the option to save the shape to a file (“shapes.txt”). The saving operation will be performed by the ShapeSaver class, which has one saveShape function, which accepts only a Shape* object into the function.
The ShapeBuilder then asks the user if they would like to build/save another shape or to exit the program.
Implementation Details
You must implement a ShapeBuilder class, a ShapeSaver class, a Shape base class, and the following classes derived from Shape: Circle, EquilateralTriangle, and Rectangle.
A circle is defined by its diameter. Valid sizes are 1 to 80.
An isosceles triangle is defined by its edge size. Valid sizes are 1 to 80.
A rectangle is defined by its height and width. Valid sizes are 1 to 80 each.
Each class must have a separate .H and .cpp file.
The Shape class must contain:
A dynamically allocated 2-D character array
The pure virtual function “build()”, which is implemented by the derived classes
The build function will ask the user for shape dimensions, allocate the appropriate memory, and assign the appropriate values into the 2-D character array {use ‘x’ for the shape; all other characters will be spaces}
You should try to put all common information into the base Shape class. Avoid repeating member variables throughout each derived class.
All dynamically allocated memory must be freed at the appropriate moment.