View Single Post
Old 03-20-2005, 06:31 PM   #2 (permalink)
Emily
 
Monster Techie

Join Date: Jul 2003

Posts: 1,179

Emily is on a distinguished road

Send a message via AIM to Emily
Default

I don't have time to write out the whole program but you need to use a while loop. First, in the beginning, ask for a starting size, display boom year, display bad year, and then ask whether to continue. Now the while loop starts, with the condition while contin == 'y'. In the body of the while loop, you need to ask if it was a boom or bad year, display the appropriate starting population, display boom year, display bad year, and ask whether the user wants to continue.

After the body of the loop is where you put the code to handle a 'n' for continue, since execution will stay in the body until the user enters n. So after the closing bracket for the while loop is where you would put the code that you have for if contin == 'n' (and you don't need an if statement anymore).

Hope this helped.
__________________
<a href=\"http://www.upstark.com\">www.upstark.com</a>
Emily is offline