158k views
2 votes
Design a program to manage the basic In-N-Out ordering of shakes and french-fries. A few menus and prompts are pasted below. Since this program is heavy on input/output interactions, please study the output for each of the test cases given. NOTE: We suggest you program incrementally. When writing input statements, end each input string with "\\" g

1 Answer

4 votes

A program to manage the basic In-N-Out ordering of shakes and french-fries, is as follows

Step-by-step explanation:

# Displays welcome message

print("~~~ Welcome to In - N - Out ~~~")

print("We\'d like to take your order")

# Displays Shake menu

print("~~ Shake Menu ~~~")

print("\t V: Vanilla ($3)")

print("\t C: Chocolate ($3)")

print("\t S: Strawberry ($3)")

print("\t N: Neapolitan ($5)")

# Accepts user choice

shakeChoice = input("Please make a selection from the above: ")

# Displays Fries menu

print("~~ Fries Menu ~~~")

print("\t A: Animal Fries ($4)")

print("\t C: Cheese Fries ($3)")

print("\t F: French Fries ($2)")

# Accepts user choice

friesChoice = input("Please make a selection from the above: ")

amount = 0

# Checks if shake choice is upper case 'V' or lowercase 'v'

if(shakeChoice == 'V' or shakeChoice == 'v' ):

# Adds 3 as cost to amount

amount += 3

# Otherwise checks if shake choice is upper case 'C' or lowercase 'c'

elif(shakeChoice == 'C' or shakeChoice == 'c' ):

# Adds 3 as cost to amount

amount += 3

# Otherwise checks if shake choice is upper case 'S' or lowercase 's'

elif(shakeChoice == 'S' or shakeChoice == 's' ):

# Adds 3 as cost to amount

amount += 3

# Otherwise checks if shake choice is upper case 'N' or lowercase 'n'

elif(shakeChoice == 'N' or shakeChoice == 'n' ):

# Adds 5 as cost to amount

amount += 5

# Checks if fries choice is upper case 'A' or lowercase 'a'

if(friesChoice == 'A' or friesChoice == 'a' ):

# Adds 4 as cost to amount

amount += 4

# Otherwise checks if fries choice is upper case 'C' or lowercase 'c'

elif(friesChoice == 'C' or friesChoice == 'c' ):

# Adds 3 as cost to amount

amount += 3

# Otherwise checks if fries choice is upper case 'F' or lowercase 'f'

elif(friesChoice == 'F' or friesChoice == 'f' ):

# Adds 2 as cost to amount

amount += 2

# Displays amount to be paid

print("You need to pay: ", amount)

User Igor Tkachenko
by
5.2k points