
#include <iostream>
#include <cmath>

#include "Rectangle.h"

using namespace std;

int main() {
    Rectangle rectangle;
    double len; 
    double wid;
 
    cin >> len;
    while (!(rectangle.setLength(len))) {
        cout << "Enter a valid value";
        cin >> len;
    }
 
    cin >> wid;
    while (!(rectangle.setWidth(wid))) {
        cout << "Enter a valid value";
        cin >> wid;
    }
 
    cout << rectangle.calcArea() << endl;
 
    return 0;
}


bool Rectangle::setWidth(double wid) { // Setter function for Width

	if (wid >= 0) {
		width = wid;
		return true; // Return true if valid
	} else {
		return false; // Return false if invalid
	}

}

bool Rectangle::setLength(double len) { // Setter function for Length

	if (len >= 0) {
		length = len;
		return true; // Return true if valid
	} else {
		return false; // Return false if invalid
	}

}

double Rectangle::getWidth() { // Getter function for Width

	return width;

}

double Rectangle::getLength() { // Getter function for Length

	return Length;

}

double Circle::calcArea() { // Calculate area for Rectangle

	double area = length * width;
	return area;

}