IO Manipulation Test

a)      Write a function rectangle with 2 input parameters, width and length.  The function will print a rectangle with * on the output screen.  Your routine shall check the validity of length and width.

b)      Write another function rectanglePlus which not only print rectangle out, but also calculate area and circumference of the rectangle.  Return these values back to the calling routine.

c)      A skeleton code is listed below.  You need to do whatever is necessary (add/change/delete) to make the program work as desired.

 

// ee104 lab test #1 main.cpp

int main()

{

cout << “my name is ” << “Frank.Lin” << endl; // replace with your name first.last

rectangle(9, 24);

cout << endl << “I finished part 1 at (what time?)” << endl;

rectanglePlus(5, 42, …..); // make it to fit your design

// print out the area and circumference

 

cout << endl << “Part 2 completed at (what time?)” << endl;

// any feedback/comments you have, add them

} // end main

 

rectangle( int width, int length ) {

…….

}

 

rectanglePlus (………) {

<< your code >>

}