Try this:
have a variable for each drink (you can have an array as well, if you want) and proceed as follows:
- when a new person comes, increment the person variable
- read their choice
- if choice = 1, increment the variable for tea, if choice = 2, inc. variable for coffee etc
- at the end, you will know that:
- you have asked 'person' persons
- teaVariable of them prefer tea
- coffeeVariable of them prefer coffee
- etc.
hope this helps.
Last edited by Chaster; Oct 19th, 2008 at 8:43 am.
Reputation Points: 12
Solved Threads: 3
Junior Poster in Training
Offline 68 posts
since Jun 2007