Sams Teach Yourself C++ in 21 Days

(singke) #1
212 Week 1

65: while (!fQuit)
66: {

67: choice = DoMenu();

68: if (choice < DrawRect || choice > Quit)
69: {
70: cout << “\nInvalid Choice, try again. “;
71: cout << endl << endl;

72: continue;
73: }

74: switch (choice)
75: {

76: case DrawRect:
77: DoDrawRect(theRect);
78: break;
79: case GetArea:

80: DoGetArea(theRect);
81: break;
82: case GetPerim:
83: DoGetPerim(theRect);
84: break;
85: case ChangeDimensions:

86: int newLength, newWidth;
87: cout << “\nNew width: “;
88: cin >> newWidth;
89: cout << “New height: “;
90: cin >> newLength;

91: theRect.SetSize(newWidth, newLength);
92: DoDrawRect(theRect);

DAY 6


DAY 3


DAY 5


DAY 7


DAY 7


DAY 4


DAY 4


DAY 5


DAY 7


LISTINGR1.1 continued

10 0672327112_w1_wir.qxd 11/19/04 12:26 PM Page 212

Free download pdf