Question: C++ (xCode) * Add constructors to the code - a default and parameterized constructor to each. * Write an .h interface and a .cpp implementation
* 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
Get step-by-step solutions from verified subject matter experts
