19.06.2013 Views

Starting Out with C++: Early Objects - EEMB DERSLER

Starting Out with C++: Early Objects - EEMB DERSLER

Starting Out with C++: Early Objects - EEMB DERSLER

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Program 5-8 (continued)<br />

The do-while Loop 261<br />

7<br />

8 int main()<br />

9 {<br />

10 // Constants for membership rates<br />

11 const double ADULT_RATE = 40.0;<br />

12 const double CHILD_RATE = 20.0;<br />

13 const double SENIOR_RATE = 30.0;<br />

14<br />

15 int choice; // Menu choice<br />

16 int months; // Number of months<br />

17 double charges; // Monthly charges<br />

18<br />

19 do<br />

20 { // Display the menu and get the user's choice<br />

21 cout

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!