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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started