0% found this document useful (0 votes)
11 views2 pages

6 Classes 1 2

Uploaded by

aa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

6 Classes 1 2

Uploaded by

aa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

//#include<iostream>

//#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();
//
//}

You might also like