i do this assigment that the dr. give it to us .. and when i want to do run for the program
this message comes " cannt execute program"
...
this is my program
# include <iostream>
using namespace std;
class Rectangle
{
protected:
float Length;
float Width;
public:
Rectangle ( float L=1, float W=1);
void setLength (float L);
void setWidth (float W);
float getLength ();
float getWidth ();
float Arectangle ();
float Crectangle ();
void printRectangle() ;
void ShowDim ();
~ Rectangle();
};
Rectangle::Rectangle( float L, float W)
{
Length= L;
Width= W;
}
void Rectangle::setLength(float L)
{
Length= L;
}
void Rectangle::setWidth(float W)
{
Width= W;
}
float Rectangle :: getLength()
{
return Length;
}
float Rectangle:: getWidth()
{
return Width;
}
float Rectangle::Arectangle ()
{
return (W*L);
}
float Rectangle::Crectangle ()
{
return (2*(W+L));
}
void Rectangle::PrintRectangle()
{
cout<< "LENGTH="<< L<< endl;
cout<< "WIDTH="<<W<<endl;
cout << "AREA="<<Arectangle ()<<endl;
cout<< "CIRCUMFERENCE=" <<Crectangle ()<<end
}
void Rectangle :: ShowDim()
{
cout<< "LENGTH="<< L<< endl;
cout<< "WIDTH="<<W<<endl;
}
Rectangle::~Rectangle()
{
cout<< "rectangle was destroyed"<<endl;
}
class RectangleClube : public Rectangle
{
protected:
float Height;
public:
RectangleClube ( float L=1, float W=1, float H=1);
void setHeight(float H);
float getHeight ();
float Vrectangle ();
void printHeight() ;
~RectangleClube();
};
RectangleClube::RectangleClube ( float L, float W, float H)
{
Height=H;
}
void RectangleClube::setHeight(float H)
{
Height=H;
}
void RectangleClube::getHeight()
{
return Height;
}
float RectangleClube:: Vrectangle ()
{
return (W*L*H);
}
void RectangleClube:: printHeight()
{
cout<< "HEIGHT=" <<H<< endl;
cout<< "VOLUME="<<Vrectangle ()<<endl;
}
void RectangleClube:: ShowDim ()
{
cout<< "LENGTH="<< L<< endl;
cout<< "WIDTH="<<W<<endl;
cout<< "HEIGHT=" <<H<< endl;
}
RectangleClube::~RectangleClube()
{
cout<<" RectangleClube was destroyed"<<endl;
}
int main()
{
Rectangle R;
R. setLength(2);
R.setWidth(3);
R. setHeight(4);
cout << "AREA="<<Arectangle ()<<endl;
cout<< "CIRCUMFERENCE=" <<Crectangle ()<<end
cout<< "VOLUME="<<Vrectangle ()<<endl;
}
can you check it for me please?!:)and tell me what is the wrong in it ..:rolleyes:
Edited by WingedPanther, 03 October 2010 - 08:57 AM.
add code tags (the # button)


Sign In
Create Account


Back to top









