armando
2014-03-15 06:30:00 UTC
please help!!!!
#include
using namespace std;
class Rectangle
{
public:
Rectangle(float= 1, float= 1);
void setWidth(float W);
float getWidth();
void setLength(float Le);
float getLength();
void perimeter();
void area();
private:
float length, width;
};
#include
#include "rectangle.h"
using namespace std;
Rectangle Rectangle (float x, float y)
{
lenght = x;
width = y;
}
void setWidth(float W){
if(W<0.0)
{
width = 0.0;
}
else if(W>20.0){
width = 20.0;
}
else{
width = W;
}
}
float getWidth(){
return width;
}
void setLength(float Le)
{
if(Le<0.0)
{
length=0.0;
}
else if(Le>20.0){
length=20.0;
}
else{
length=Le;
}
}
float getLength()
{
return length;
}
void perimeter(){
float b;
b = 2 * getLength + 2 * getWidth;
}
void area(){
float a;
a = getLength * getWidth;
}
#include
#include "rectangle.h"
using namespace std;
int main()
{
Rectangle myRectangle(5.0, 2.0);
cout<<"the perimeter is:"<
return 0;
}