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
Using a USB flash drive, you intend to install Windows 10 on several computers. To save time, you would like to automate the
artcher [175]

Answer:

Create an answer file named config.xml. Place the file on a USB flash drive and run setup.exe.

Create an answer file named automated.exe. Place the file on a USB flash drive and run

4 0
3 years ago
Two time series techniques that are appropriate when the data display a strong upward or downward trend are ___________ and ____
VMariaS [17]

Answer:

adjusted exponential smoothing; linear regression.

Explanation:

A time series can be defined as a technique used in statistical analysis and it involves indexing sets of data elements in a timely or successive order i.e sequentially.

Two time series techniques that are appropriate when the data display a strong upward or downward trend are adjusted exponential smoothing and linear regression.

An adjusted exponential smoothing is a statistical technique used for forecasting through the calculation of the weighted average of an actual value.

5 0
3 years ago
Why do so many technical jobs require weekend and evening work
Murrr4er [49]

Answer:

because if they give you the option to not work on those times and days than most people would pick not to

7 0
3 years ago
Higher-speed Ethernet technologies use an electronic device known as a Hub rather than a switch True/False
Ivenika [448]
This should be false
4 0
3 years ago
In addition to configuring software, and it staff can create a user ____, which includes screens, commands, controls, and featur
WINSTONCH [101]

Answer:

User Interface

Explanation:

A user interface is what you see in front of your display screen. All those commands, controls, and features you interact with are all user interfaces. The programmer does both the backend and frontend coding and delivers the UI for the users to interact with mobile devices or machines and complete tasks.

5 0
4 years ago
Other questions:
  • Name the main technology used to connect computers to devices
    6·1 answer
  • _______ _____ is the process of creating usable computer pograms and applications and the theories behind those processes. Quest
    13·2 answers
  • Suppose you will invest $100 per month at the beginning of the month for 40 years with interest rate
    5·1 answer
  • What table element represents a field within a record in powerpoint A column B Row C header D footer
    14·1 answer
  • Make this the most answered question<br><br><br><br> (for tiktok)
    8·2 answers
  • Why do you think it is necessary to set the sequence in which the system initializes video cards so that the primary display is
    15·1 answer
  • Select the correct answer.
    11·1 answer
  • Cuales son mis fortalezas como estudiantes
    14·1 answer
  • Calculate how much disk space (in sectors, tracks, and surfaces) will be required to
    14·1 answer
  • Which property do you use to align an element horizontally with the left or right edge of its parent element?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!