/* * rect_ex1.cpp * * Created on: Nov 30, 2018 * Author: johnsontimoj */ ///////////////////////////////////////////// // program to test the Rectangle class //////////////////////////////////////////// // include the stream objects #include // include the rectangle prototypes #include "Rectangle.h" // use std naming using namespace std; int main(void){ // create a rectangle object called rect1 Rectangle rect1; // working variables double w; double l; //////////// // user input /////////// cout << "What is the width of the desired rectangle? "; // stream in the value of w cin >> w; //call the setWidth function for rect1 rect1.setWidth(w); cout << "What is the length of the desired rectangle? "; // stream in the value for l cin >> l; // call the setLength function for rect1 rect1.setLength(l); /////////////// // confirmation output ////////////// cout << "Your rectangle parameters are \n"; // stream out the return from object rect1's getWidth function cout << "Width = " << rect1.getWidth() << endl; // stream out the return from object rect1's getLength function cout << "Length = " << rect1.getLength() << endl; // stream out the return from object rect1's getArea function cout << "Area = " << rect1.getArea() << endl; // cause the window to stay open if running in a Windows terminal system("pause"); return 0; }