Question: C++ (xCode) * Add constructors to the code - a default and parameterized constructor to each. * Write an .h interface and a .cpp implementation

C++ (xCode)

* Add constructors to the code - a default and parameterized constructor to each.

* Write an .h interface and a .cpp implementation for each class

* Write an Drive/Test file that tests the constructors and functions

* Write a UML class diagram for each class

*********************************************************************************

// classes example

#include

usingnamespacestd;

classRectangle

{

intwidth, height;

public:

voidset_values (int,int);

intarea()

{

intanswer;

answer = width * height;

returnanswer;

}

};

voidRectangle::set_values (intx,inty)

{

width = x;

height = y;

}

intmain ()

{

Rectangle rect1;

rect1.set_values (5,6);

cout

Rectangle rect2;

rect2.set_values (3,4);

cout return0;

return0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!