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
Debora [2.8K]
4 years ago
6

A bakery sells three types of muffins whose prices are as follows: 1- blueberry muffin, $2.98 2- chocolate chip muffin, $4.50 an

d 3- banana muffin, $9.98. You will write an application which calculates the total retail value of the sold muffins. Please check the following requirements: • Create a sentinel-controlled while loop. The flag value will be 0. Display flag value in your messages. • Display the menu and ask for the muffin

Computers and Technology
1 answer:
andreev551 [17]4 years ago
7 0

Explanation:

The menu is provided as given in the question. A while loop is used to keep getting input from the user until the user enters exit value 0. If elif commands are used to keep track of the respective muffins. Three counters are used to keep the count of each muffin and at the end the quantity of each muffin is multiplied with the price of each muffin then added together to get the total bill.

Python Code:

menu="""****************MENU*******************

Please select your muffins:      

Press 1 for blueberry muffin $2.98      

Press 2 for chocolate chip muffin $4.50

Press 3 for banana muffin $9.98        

Press 0 for exit!                

***************************************"""

print(menu)

blue=0

chock=0

banana=0

flag=0

while flag==0:

   inp=eval(input())

   if inp==1:

       blue+=1

       print("blueberry muffin added")

   elif inp==2:

       chock+=1

       print("chocolate muffin added")

   elif inp==3:

       banana+=1

       print("banana muffin added")

   elif inp==0:

       break

   else:

       print("invalid selection!")    

print("Your bill is: $",blue*2.98+chock*4.50+banana*9.98)

Output:

*******************MENU**********************

Please select your muffins:      

Press 1 for blueberry muffin $2.98      

Press 2 for chocolate chip muffin $4.50

Press 3 for banana muffin $9.98      

Press 0 for exit!

***************************************"*********

2

chocolate muffin added

3

banana muffin added

5

invalid selection!

1

blueberry muffin added

0

Your bill is: $ 17.46

You might be interested in
What is output by the following code segment? int x = 11; int y = 11; if (x != y ) { System.out.print("one"); } else if (x >
meriva

The output will be four because y and x are equal and that satisfies the condition for the else if statement that prints out four.

3 0
3 years ago
In everyday life, we use numbers based on a combination of digits between 0 and 9.
serious [3.7K]

Answer:

denary is the answer thank you

3 0
3 years ago
What kind of job is NOT at greater risk for workplace violence?
natta225 [31]
Well this isnt a computer and technology question ut ill still answer it... youve got being an IT person, Working at build- a-bear, laundry mat, babysitter, there is many different ones
4 0
4 years ago
You are in the process of replacing the toner cartrige for a laser printer. however, you notice that toner particles have been s
makkiz [27]

Answer:

Toner vacuum

Explanation:

In the process of replacing the toner cartrige for a laser printer, whenever you notice that toner particles have been split inside the printer, what you should use to effectively remove these particles is a TONER VACUUM, it is a device specially created for that purpose, after using a toner vacuum, you can use the activated toner clothe to clean the rest, after which I will advise you to use an aerosol spry to get the best result.

8 0
4 years ago
How to sync music from my phone to groove music
Svetllana [295]
<span><span>Make sure your device supports OneDrive music. Music will not show up on Windows 8, Windows Phone 8, Zune, or Windows Media Player. To find out whether your device supports OneDrive content, See System requirements above.</span><span>Make sure your music is in your OneDrive Music folder.</span>Make sure your music files are one of the supported file types: MP3, M4A, or WMA unprotected. Protected files added to your OneDrive Music folder will not show up on other devices.<span>Check to see that you're not over the 50,000 track limit in your Music collection. If you have more than 50K files in your OneDrive music folder, only the first 50K files will show.
Note Co-owned (or shared) folders are not supported.</span></span>
If your music still doesn't show up, try the following steps:<span><span>Start Internet Explorer and open an InPrivate Session.</span><span>Go to Groove and sign in with your Microsoft account.</span>Select "In OneDrive" and look for your music.If it doesn't appear, wait about 5 minutes for your music to be synced to OneDrive.<span>Refresh the page. Your music should now appear.</span></span>
4 0
3 years ago
Other questions:
  • What helps in determining the reliability of a person to repay debt?
    12·2 answers
  • The bias condition for a transistor to be used as a linear amplifier is called:________.
    14·1 answer
  • What is the first computer was brought in nepal and for what purpose​
    12·2 answers
  • Assume that the system has a multiple level queue with a variable time quantum per queue, and that the incoming job needs 80 ms
    14·1 answer
  • List the six external parts or "peripherals" of a computer system and identify which are the output and which are the input devi
    6·1 answer
  • Which of the following journals is not aimed at the public as well as scientists?
    7·1 answer
  • What will be displayed after the following statements execute? int funny = 7, serious = 15; funny = serious % 2; if (funny != 1)
    10·2 answers
  • Linux implements _________ to determine how a user is to be authenticated and whether there are password policies associated wit
    11·1 answer
  • How is hybrid computer used in hospitals? please reply fast!!​
    14·1 answer
  • True or false windows 98 and windows xp are examples of an operating system?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!