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
A hardware component that keeps data and information when the device is not powered is called a ____ device.
serious [3.7K]

It should be noted that the hardware component that keeps data and information when the device is not powered is called a storage device.

This device can be permanent or temporary storage device.

<h3>What is a storage device?</h3>

Storage device can be regarded as the device that store data.

There are different storage devices for the computer system, they includes;

  • Optical Storage Devices.
  • External HDDs
  • Random Access Memory
  • Flash memory devices.
  • Floppy Disks.

Learn more about storage device at ;

brainly.com/question/21283135

5 0
2 years ago
04. Suppose a computer program needs to sort a list of student records in ascending order
34kurt

Answer:

D) ["Kathy Bones", "Jill Brewer", "Joe Schnook", "Tom Smith"]

Explanation:

The context of the problem explains a computer program that sorts names in "ascending order" (A to Z) since the ASCII table has capital A start a lower number and it increases from there to capital Z.

Notice how the attached file, which is a portion of the ASCII table, shows that letters after A are also higher in decimal value than the previous letter.

With this in mind, we know that all this program does is sort by last name alphabetical order. From there, just sort the given names using that same criteria, last name alphabetical order, and the correct answer is determined.

<em>Please put "Brainliest" on my answer if it helped you out!</em>

<em>If you want to learn more about this subject, you can search:</em>

<em>- ASCII Table</em>

<em>- Lists in Programming</em>

<em>- Sorting Procedures</em>

7 0
2 years ago
Write a function all_cats that consumes a comma-separated string of animals and prints whether all of the animals have "cat" in
RoseWind [281]

Answer:

  • Image 1 is for the function defining all_cats():

       (All the explanation is given in comments before each statement)

  • Image 2 has the code for testing the function all_cats()
  • Last image has the output of the code.

8 0
3 years ago
The stack ADT may be implemented with
Masteriza [31]

Answer: (c)All others answers

Explanation: Stack ADT is the group of the objects that are present  to work according to the last in first out strategy for the abstract data types. It works on the insertions and deletion of the elements that is referred as the push and pop action.

The ADT stacks can works with arrays, links list as well as vectors for the operation .Therefore, the correct option is option(c)

4 0
3 years ago
This is the term popularly used to describe fixing errors in a computer program.
Setler79 [48]
C) Debugging. Debugging is when you fix the errors in your code
5 0
3 years ago
Read 2 more answers
Other questions:
  • A computer that stores and distributes newsgroup messages is called a newsreader.
    13·1 answer
  • Suppose two hosts, A and B, are connected by a 10 Mbps link. The length of a packet is 12 Kb (Kilobits, i.e., 12 × 103 bits). Th
    15·1 answer
  • What is the syntax of an of if statement
    13·1 answer
  • Online transaction processing (OLTP) and online analytical processing (OLAP) are similar MIS strategies used to help with busine
    9·1 answer
  • What is a software? 2 sentences please, I'll mark u as brailiest
    12·1 answer
  • If you face an investigation where dangerous substances might be around, you may need to obtain which of the following?
    13·2 answers
  • Steps for turning off 2 step verification on iPhones
    10·1 answer
  • Service and software companies typically have a high return-on-assets ratio because they require lower blank as compared to manu
    11·2 answers
  • Which of the following is the fastest computer processing speed?
    10·1 answer
  • Use USB in a sentence
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!