Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C++ by minhkhanh ( 4 years ago )
#include "Rectangle.h"
Rectangle::Rectangle()
{
length = 1;
height = 1;
count++;
}
Rectangle::Rectangle(double lenght, double heigth)
{
lenght = length;
heigth = heigth;
Rectangle::count++;
}
Rectangle::~Rectangle()
{
count--;
}
Rectangle::Rectangle(const Rectangle& rect)
{
}
int Rectangle::getCount()
{
return count;
}
ostream& operator<<(ostream& out, const Rectangle& rec)
{
cout << "\nChieu dai HCN= ";
out << rec.length;
cout << "\nChieu rong HCN= ";
out << rec.height;
return out;
}
istream& operator>>(istream& in, Rectangle& rec)
{
cout << "\nNhap vao length= ";
in >> rec.length;
cout << "\nNhap vao heigth= ";
in >> rec.height;
return in;
}
void Rectangle::print()
{
cout << "\nThe num ber of object created are: " << count;
}
Revise this Paste
Parent: 121551