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
algol [13]
3 years ago
14

A cookie recipe calls for the following ingredients: • 1.5 cups of sugar • 1 cup of butter • 2.75 cups of flour The recipe produ

ces 48 cookies with this amount of ingredients. Write a program that asks the user how many cookies they want to make and then displays the number of cups of each ingredient needed for the specified number of cookies in the following format: You need 5 cups of sugar, 3 cups of butter, and 7 cups of flour.

Computers and Technology
1 answer:
True [87]3 years ago
4 0

The program that asks the user how many cookies they want to make and then displays the number of cups of each ingredient is corresponds to the ingredients mentioned above.

<h3>Further explanation</h3>

Python is a general-purpose programming language. We want to write a python program that asks the user how many cookies they want to make and then displays the number of cups of each ingredient.

48 cookies = 1.5 cups of sugar + 1 cup of butter + 2.75 cups of flour, so:

def main():

   cookies = float(input("How many cookies would you like to make?\n>"))

   sugar = (1.5 * cookies) / 48.0

   butter = cookies / 48

   flour = (2.75 * cookies) / 48

   print("To make ", cookies, " cookies, you will need:\n", \

         format(sugar, '.2f'), " cups of sugar\n", \

         format(butter, '.2f'), " cups of butter\n", \

         format(flour, '.2f'), " cups of flour", sep='')

   redoQuery()  

def redoQuery():

   yn = input("Would you like to check another batch size? (y/n)\n>")

   if yn == 'y':

       main()

   elif yn =='n':

       exit()

   else:

       print("Please enter only a lowercase \'y\' or lowercase \'n\'," \

             "then press enter")

       redoQuery()

main()

The run program is shown in the attachment below.

<h3>Learn more</h3>

1. Learn more about python https://brainly.in/question/8049240

 

<h3>Answer details</h3>

Grade:  9

Subject: Computers and Technology

Chapter:  programming with python

Keywords: python

You might be interested in
The _ are the devices that allow a computer system to communicate and interact with the outside world as well as store informati
padilas [110]

Answer:

I think the answer is the central processing unit. Hope it helps!!!!!

5 0
3 years ago
must understand both art and engineering. a. industrial designer b. environmental designer c. interior designer d. graphic desig
enot [183]
It's d. Graphic designer because they design things on the computer with code
7 0
3 years ago
When assembling a desktop computer you should always install the drives before the motherboard?
s2008m [1.1K]
Yes you should install drives first
8 0
3 years ago
You're programming an infinite loop. What must you include in your code to prevent crashes?
natta225 [31]

You have to put repeat

4 0
3 years ago
Read 2 more answers
John Cleaver is the CEO of Tech World, which is a retail store that sells computers, monitors, cameras, televisions and many oth
Norma-Jean [14]
The answer would be b. Contemplate other products to introduce at the same time in this new market.
5 0
3 years ago
Other questions:
  • What effect can camera tilt create? Do you think this is effective? Why or why not?
    13·1 answer
  • ________ is a program that runs on a computer to manage and control a computer's activities.
    11·1 answer
  • Match the part of motherboard to its function
    15·1 answer
  • Assume you have a int variable n that has already been declared and initialized. Its value is the number of integers that need t
    13·1 answer
  • A customer in a store is purchasing 5 items. Write a python program that asks for the price of each item and display the subtota
    14·1 answer
  • Within a major students can choose to study a specific area within major. For example a journalism student may study military jo
    8·1 answer
  • Excel spread sheets are primarily used to
    13·2 answers
  • This assignment will again take the form of a compare/contrast essay. You will use the fresco of Christ Teaching the Apostles in
    14·1 answer
  • What would a system unit that is integrated with the display and keyboard would be considered?
    6·1 answer
  • Define foreign employment​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!