I am trying to write the pseudocode for this.
(1) Hot dog 1.50
(2) Fries 1.00
(3) Lemonade .75
(4) End order
You should be allowed to keep ordering from the menu until you press 4 for End order, at which point you should see a total amount due for your entire order.
So far I have this:
mainLoop()
output "1. HotDog: $1.50"
output "2. Fries: $1.00"
output "3. Lemonade: $0.75"
output "4. End of Order"
input choice
if choice = 1 (totalCost = totalCost + 1.50)
if choice = 2 (totalCost = totalCost + 1.00)
if choice = 3 (totalCost = totalCost + 0.75)
if choice = 4 (EXIT LOOP)
output "The total cost of your order is: " totalCost
Am I on the right track here? Will I be reassigning totalCost a new value each time instead of adding each cost together with the way I have it written? Thanks!
2007-12-16
08:06:07
·
2 answers
·
asked by
Butterfli
2
in
Computers & Internet
➔ Other - Computers