Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Could someone possibly help me with this c++ program? For this program, you will

ID: 3831962 • Letter: C

Question

Could someone possibly help me with this c++ program?

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 diameter 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 equilateral 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}

Explanation / Answer

#include using namespace std; class Rectangle { public: int width; int height; Rectangle(int w,int h) : width(w) , height(h) {} int GetArea() { return width * height; } }; int main() { int w, h; cout > w; cout > h; // make the Rectangle based on the given w/h Rectangle rect(w,h); // print the area cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote