Question: #include using namespace std; class Rectangle { public: void SetSize ( int heightVal, int widthVal ) { height = heightVal; width = widthVal; } int
#include using namespace std; class Rectangle public: void SetSizeint heightVal, int widthVal height heightVal; width widthVal; int GetArea const; int GetPerimeter const; private: int height; int width; ; int Rectangle::GetArea const return height width; int Rectangle::GetPerimeter const return height width ; int main Rectangle myRectangle; myRectangle.SetSize; if myRectangleGetArea cout "FAILED GetArea for endl; if myRectangleGetPerimeter cout "FAILED GetPerimeter for endl; myRectangle.SetSize; if myRectangleGetArea cout "FAILED GetArea for endl; if myRectangleGetPerimeter cout "FAILED GetPerimeter for endl; return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
