subject

And Python code for the following programming problem and the pseudo code below Write a modular program that will calculate the cost of purchasing a meal. The Python program can use global or local variables and RAPTOR use global variables. This program will include decisions and loops. Details of the program are as follows:
• Your menu items only include the following food with accompanied price:
o Yum Yum Burger = .99
o Grease Yum Fries = .79
o Soda Yum = 1.09
• Allow the user of the program to purchase any quantity of these items on one order.
• Allow the user of the program to purchase one or more types of these items on one order.
• After the order is placed, calculate total and add a 6% sales tax.
• Print to the screen a receipt showing the total purchase price.

Your sample output might look as follows:

Enter 1 for Yum Yum Burger
Enter 2 for Grease Yum Fries
Enter 3 for Soda Yum
Enter now ->1
Enter the number of burgers you want 3
Do you want to end your order? (Enter yes or no): no

Enter 1 for Yum Yum Burger
Enter 2 for Grease Yum Fries
Enter 3 for Soda Yum
Enter now ->3
Enter the number of sodas you want 2
Do you want to end your order? (Enter yes or no): no

Enter 1 for Yum Yum Burger
Enter 2 for Grease Yum Fries
Enter 3 for Soda Yum
Enter now ->1
Enter the number of burgers you want 1
Do you want to end your order? (Enter yes or no): no

Enter 1 for Yum Yum Burger
Enter 2 for Grease Yum Fries
Enter 3 for Soda Yum
Enter now ->2
Enter the number of fries you want 2
Do you want to end your order? (Enter yes or no): yes

The total price is $ 8.1832
Do you want to end program? (Enter no to process a new order): no

Enter 1 for Yum Yum Burger
Enter 2 for Grease Yum Fries
Enter 3 for Soda Yum
Enter now ->2
Enter the number of fries you want 2
Do you want to end your order? (Enter yes or no): no
Enter 1 for Yum Yum Burger
Enter 2 for Grease Yum Fries
Enter 3 for Soda Yum
Enter now ->3
Enter the number of sodas you want 2
Do you want to end your order? (Enter yes or no): yes

The total price is $ 3.9856
Do you want to end program? (Enter no to process a new order): yes

The Pseudo code is:

Module main()

Call declareVariables(endProgram, endOrder, totalBurger, totalFry, totalSoda, total, tax, subtotal, option, burgerCount, fryCount, sodaCount)

//Loop to run program again
While endProgram == "no"

Call resetVariables(totalBurger, totalFry, totalSoda, total, tax, subtotal)
//Loop to take in order
While endOrder == "no"
Display "Enter 1 for Yum Yum Burger"
Display "Enter 2 for Grease Yum Fries"
Display "Enter 3 for Soda Yum"
Input option
If option == 1 Then
Call getBurger(totalBurger, burgerCount)
Else If option == 2 Then
Call getFry(totalFry, fryCount)
Else If option == 3 Then
Call getSoda(totalSoda, sodaCount)
End If

Display "Do you want to end your order? (Enter no to add more items: )"
Input endOrder
End While

Call calcTotal(burgerTotal, fryTotal, sodaTotal, total, subtotal, tax)
Call printReceipt(total)

Display "Do you want to end the program? (Enter no to process a new order)"
Input endProgram
End While

End Module

Module declareVariables(String Ref endProgram, String Ref endOrder, Real Ref totalBurger, Real Ref totalFry, Real Ref totalSoda, Real Ref total, Real Ref tax, Real Ref subtotal, Real Ref option, Real Ref burgerCount, Real Ref fryCount, Real Ref sodaCount)
Declare String endProgram = "no"
Declare String endOrder = "no"
Declare Real totalBurger = 0
Declare Real totalFry = 0
Declare Real totalSoda = 0
Declare Real total = 0
Declare Real tax = 0
Declare Real subtotal = 0
Declare Integer option = 0
Declare Integer burgerCount = 0
Declare Integer fryCount = 0
Declare Integer sodaCount = 0
End Module

Module resetVariables (Real Ref totalBurger, Real Ref totalFry, Real Ref totalSoda, Real Ref total, Real Ref tax, Real Ref subtotal)

//reset variables
totalBurger = 0
totalFry = 0
totalSoda = 0
total = 0
tax = 0
subtotal = 0
End Module

Module getBurger(Real Ref totalBurger, Integer burgerCount)
Display "Enter the number of burgers you want"
Input burgerCount
Set totalBurger = totalBurger + burgerCount * .99
End Module

Module getFry(Real Ref totalFry, Integer fryCount)
Display "Enter the number of fries you want"
Input fryCount
Set totalFry = totalFry + fryCount * .79
End Module

Module getSoda(Real Ref totalSoda, Integer sodaCount)
Display "Enter the number of sodas you want"
Input sodaCount
Set totalSoda = totalSoda + sodaCount * 1.09
End Module

Module calcTotal(Real totalBurger, Real totalFry, Real totalSoda, Real Ref total, Real subtotal, Real tax)
Set subtotal = totalBurger + totalFry + totalSoda
Set tax = subtotal * .06
Set total = subtotal + tax
End Module

Module printReceipt(Real total)
Display "Your total is $", total
End Module

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 00:30
Which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 2
question
Computers and Technology, 23.06.2019 12:00
What type of slide show is a dynamic and eye-catching way to familiarize potential customers with what your company has to offer? a. ole b. photo album c. brochure d. office clipboard
Answers: 2
question
Computers and Technology, 24.06.2019 02:50
Be sure to answer all parts. synthesize the following compound from benzene. a. b. c. d. e. f. reaction [1] conditions: a b c d e f reaction [1] product: draw structure reaction [2] conditions: a b c d e f reaction [2] product: draw structure reaction [3] conditions: a b c d e f reaction [3] product:
Answers: 3
question
Computers and Technology, 24.06.2019 05:30
Why is hard disk space important to an audio engineer? why are usb ports and firewire ports useful for an audio engineer? explain in 2-3 sentences. (3.0 points) here's a list of different audio software: ableton live apple inc.'s garageband apple inc.'s logic studio digidesign's pro tools propellerhead sofware's reason sony creative software's acid pro steinberg cubase steinberg nuendo choose one of the software programs listed above, and then go to that software program's web site. read about what the software program is used for, and then write 4-5 sentences about what you learned. (10.0 points) which type of software license is the most limiting? why? explain in 2-3 sentences. (3.0 points) when sending a midi channel voice message, how can you control the volume of the sound? explain in 2-3 sentences. (4.0 points)
Answers: 1
You know the right answer?
And Python code for the following programming problem and the pseudo code below Write a modular pro...
Questions
Questions on the website: 13722367