6 Classes 1 2
6 Classes 1 2
//#include<string>
//using namespace std;
//
//
//class Rectangle
//{
//public:
// //data member
// int height_;
// int width_;
//
//
// //member function
// int calculateArea()
// {
// return height_ * width_;
// }
//
// void printRectangle()
// {
// for (int i = 0; i < height_; i++)
// {
// for (int j = 0; j < width_; j++)
// {
// if (i == 0 || i == height_ - 1 || j == 0 || j == width_ -
1)
// cout << "*";
// else
// cout << " ";
// }
// cout << endl;
// }
// }
//
// void printArea()
// {
// cout << "The area of rectangle 1 with height: " << height_ << " and
width: " << width_ << " is:" << calculateArea() << endl << endl;
// }
//};
//
//int main()
//{
// Rectangle r1;
// cout << "Enter the height of the rectangle:";
// cin >> r1.height_;
//
// cout << "Enter the width of the rectangle:";
// cin >> r1.width_;
//
// r1.printArea();
//
// r1.printRectangle();
//
// Rectangle r2;
// r2 = r1;
//
// cout<<r2.calculateArea();
//
//}