hi ,
my program calculate the area of rectangle , and I have some errors , and dont know how to correct them .
this is the program ,
#include<iostream>
using namespace std;
class Rectangle {
private:
double length ,width ;
public:
double getW();
double getL();
void setW();
void setL(); double findArea(double&;double&);
void display();
};
double Rectangle::getW(){
return width ;
}
double Rectangle::getL(){
return length ;
}
void Rectangle::setW(double num1){
width=num1;
}
void Rectangle::setL(double num2){
length=num2;
}
double Rectangle::findArea(double &w;double &l){
int area;
w=width;
l=length;
area=length*width;
return area ;
void Rectangle::display(){
cout<<length<<endl;
cout<<width<<endl;
}
int main (){
double x=8.3,y=5.8;
Rectangle rec ;
rec.setW(x);
rec.setL(y);
rec.getW();
rec.getL();
rec.findArea(x,y);
rec.display();
}
return 0 ;
}