1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sashaice [31]
2 years ago
5

And Python code for the following programming problem and the pseudo code below

Computers and Technology
1 answer:
lora16 [44]2 years ago
6 0

Answer:

endProgram = "no"

endOrder = "no"

totalBurger = 0

totalFry = 0

totalSoda = 0

total = 0

tax = 0

subtotal = 0

option = 0

burgerCount = 0

fryCount = 0

sodaCount = 0

def resetVariables():

    #reset variables

   totalBurger = 0

   totalFry = 0

   totalSoda = 0

   total = 0

   tax = 0

   subtotal = 0

def getBurger():

   global burgerCount

   burgerCount += int(input("Enter the number of burgers you want: "))

   totalBurger =burgerCount * .99

   return totalBurger

def getFry():

   global fryCount

   fryCount += int(input("Enter the number of fries you want: "))

   global totalFry

   totalFry +=fryCount * .79

   return totalFry

def getSoda():

   global sodaCount

   sodaCount += int(input("Enter the number of sodas you want: "))

   global totalSoda

   totalSoda +=sodaCount * 1.09

   return totalSoda

def calcTotal():

   global subtotal

   subtotal += totalBurger + totalFry + totalSoda

   global tax

   tax += subtotal * .06

   global total

   total += subtotal + tax

   return total

def printReceipt(total):

   print("Your total is $",round(total, 2))

#Loop to run program again

while endProgram == "no":

   resetVariables()

   #Loop to take in order

   while endOrder == "no":

       print("Enter 1 for Yum Yum Burge\nEnter 2 for Grease Yum Fries\nEnter 3 for Soda Yum: \n")

       option = int(input("Enter option: "))

       if option == 1:

           bugertotal = getBurger()

       elif option == 2:

           frytotal = getFry()

       elif option == 3:

           sodatotal = getSoda()

       endOrder = input("Do you want to end your order? (Enter no to add more items): ")

       mytotal = calcTotal()

       printReceipt(mytotal)

   endProgram = input("Do you want to end the program? (Enter no to process a new order): ")

Explanation:

The python source code displays the menu of a restaurant and the prices of each meal. The module takes multiple orders, calculates and displays the total bill of the order with tax included.

You might be interested in
Why is my speedtest is very good but chrome is slow
olga55 [171]
Maybe you have lots of tabs open
5 0
2 years ago
Given that two int variables, total and amount, have been declared, write a loop that reads integers into amount and adds all th
Whitepunk [10]

Answer:

Following are the statement in C++ Language is given below

total=0; // variable declaration

cin >> amount; // Read the input

while(amount >=0) //iterating the loop

{

if(amount>0) // checking condition

total=total+amount; // perform operation

}

Explanation:

Following is the description of the statement

  • Declared a variable "total" and initialized with them 0 to them.
  • Read the input in the "amount" variable by using cin.
  • iterating the loop when the amount is greater then 0.
  • Checking the condition if(amount>0) then adding the total variable and amount and storing them into the total variable.

8 0
3 years ago
Use the modulo operator (%) to get the desired rightmost digits. Ex: The rightmost 2 digits of 572 is gotten by 572 % 100, which
uranmaximum [27]

Hi, you haven't provided the programing language in which you need the code, I'll just explain how to do it using Python, and you can apply a similar method for any programming language.

Answer:

def rightMost(num):

   lenNum = len(str(num))

   rightNum = num%(10**(lenNum-1))

   print(rightNum)

   return(rightNum)

Explanation:

In this function we receive an integer number, then we find how many digits this number has, and finally, we find the rightmost digits; the main operation is modulo (takes the remainder after a division), what we want is to take all the digits except the first one, for that reason we find the modulo of the number when divided by ten to the power of the length of the number minus one, for example, if the number is 2734 we divided by 10^(4-1), where four is the length of the number, this way we get 2734/1000 and the module of it is 734.

5 0
3 years ago
25 points select 3 options!!!!!!!!!!!!!!!!!!!!!!!!!
STALIN [3.7K]
A, B , and E sorry if I’m wrong
4 0
2 years ago
Dakota's friend Stephen created a cypher using the QWERTY keyboard, but Dakota is confused. Stephen said to move one to the righ
Radda [10]

Answer:

people are so confusing nowadays... Mr. Kopin told me to get him a coffee. I'm not his servant!

Explanation: QWERTY Q=P A=L Z=M and the others are what is to the left of them.

5 0
2 years ago
Other questions:
  • Help asap. 10 points.
    8·2 answers
  • A design tool helps you plan, evaluate, and explain your ideas to create a product. Some examples of design tools are outlines,
    10·2 answers
  • A list of pages within a Web site that you have visited and that usually appears at the top of a page is referred to as a(n) ___
    14·1 answer
  • When did the mantle of the earth form
    14·2 answers
  • I need 3 sentences on adware.<br> What they do and how they are a risk.
    5·1 answer
  • MacBook Pro (2019) at 93% max capacity battery rating after 100 charge cycles. Is this normal? Used coconut battery to check thi
    10·2 answers
  • Part 2: Code the Program
    12·1 answer
  • What are the specifications for a mine shaft headgear ​
    10·1 answer
  • Wight an essay on Knowledge sharing among robots.<br> please and please do not delete my question.
    7·1 answer
  • The…..executed simple
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!