your name, the compiler and operating system used, and Lab Exercise #7 in a comment at the
top of your program. Email your source code. You
may email your lab solution prior to that.
Modify example, Program
13-1 from the textbook, by adding a data member, color (use type string) and 2 member functions, setColor() and getColor() to the class. Use the
main() function below to test your code.
Rectangle box; // Define an instance of the Rectangle class
double rectWidth; // Local variable for width
double rectLength; // Local variable for length
string rectColor; // Local variable for color
// Get the rectangle's width and length from the user.
cout << "This program will calculate the area of a\n";
cout << "rectangle. What is the width? ";
cin >> rectWidth;
cout << "What is the length? ";
cin >> rectLength;
cout << "What is the color? ";
cin >> color;
// Store the width and length and color of the rectangle
// in the box object.
// Display the rectangle's data.
cout << "Here is the rectangle's data:\n";
cout << "Width: " << box.getWidth() << endl;
cout << "Length: " << box.getLength() << endl;
cout << "Area: " << box.getArea() << endl;
cout << "Color: " << box.getColor() << endl;