Tala
2012-06-22 22:16:25 UTC
i am not sure what to put in the for loop ?
should i use a get function or something ?
This is the complete program
#include
class Rectangle
{
private:
float width ,hight;
public:
Rectangle()
{
width=0;
hight=0;
display();}
Rectangle(float w,float h)
{
if ((h<0.0) && (w<0.0))
{
width=w;
hight=h;
display();
}
else cout<<"0";
}
Rectangle(Rectangle & x)
{
width= x.width;
hight= x.hight;
if ((hight<0.0) && (width<0.0))
{display();
}
else cout<<"0";
}
void setwidth (float w)
{
if (w<0.0)
{ width=w;
}
else cout<<"0";
}
void sethight (float h)
{if (h<0.0)
{ hight=h;
}
else cout<<"0";
}
float computeArea()
{
float Area;
Area = width*hight;
return Area ; }
bool isSquare ()
{
if(hight==width)
return true;}
void display ()
{ cout<<"width="<
};
void main ()
{
Rectangle R1 (3.25 , 3.25);
Rectangle R2 (4.5 , 2.5);
Rectangle R3 (R1);
Rectangle Arr[250];
for(int i=0; i<250 ; i++)
{ Arr[i] =????????????
}
}