Loops 4 - sentinel, menu


examples


Classwork

In a text document:

For each, think about input, including variable names and types; prompt the user for input.

Create a menu for buying birds where the options are

1 See Current total
2 Buy Chicken
3 Buy Goose
4 Parrot Menu
5 Check Out

They should be able to see their current total, buy a chicken, which adds $20 to the current total, buy a goose, which adds $30 to the current total, or enter the Parrot Menu.  If they choose Check Out the menu ends

The parrot menu has options

1 Buy Parrot
2 Buy Training Course
3 Return to Main Menu

If they buy a parrot, it adds $50 to the current total.  If they buy a training course, have them enter words they want to train the parrot to say, as many as they want, and "QUIT" to stop.  Assume you have a module addWord(wordGoesHere) that you can use to add a word to be taught.  For each word they add, also add $10 to the total

The user should be able to go into and out of the parrot menu repeatedly before quitting the program

After they check out, print their total again and thank them for shopping