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

3. (Constructor 15 Points) We declare the following class, where the constructor

ID: 3704794 • Letter: 3

Question

3. (Constructor 15 Points) We declare the following class, where the constructors are missing. Please add the following three constructors in the rectangle class and implement the constructors. .The first constructor takes no input parameters. The height and width are set to 3 and 4, respectively member is set to height value; the width member is set to 4 class rectangle int height; int width; // A simple class public: // the first constuctor, // the second constuctor, // the third constuctor rectangle (void) // this is a destructor

Explanation / Answer

class rectangle { int height; int width; public: rectangle(); rectangle(int height_value); rectangle(int height_value, int width_value); ~rectangle(); }; rectangle::rectangle() { height = 3; width = 4; } rectangle::rectangle(int height_value) { height = height_value; width = 4; } rectangle::rectangle(int height_value, int width_value) { height = height_value; width = width_value; } rectangle::~rectangle() { }

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