/* Filename: area4.cpp Author: Br. David Carlson Br. Isidore Minerd Date: January 4, 2000 Modified: June 26, 2000; August 19, 2001; July 16, 2009 This program asks the user to enter the length and width of a rectangle. It then computes and prints the area of the rectangle. Tested with: Microsoft Visual C++ 6.0 Microsoft Visual C++ .NET Microsoft Visual Studio 2008 g++ under Linux */ #include using namespace std; int main(void) { float Length, Width, Area; cout << "Enter the rectangle's length (as a real): "; cin >> Length; cout << "Enter the rectangle's width (as a real): "; cin >> Width; if ((Length > 0) && (Width > 0)) { Area = Length * Width; cout << endl << "The area is: " << Area << endl << endl; } else { cout << "Cannot compute area. Length and width must be positive." << endl << endl; } return 0; }