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
I need help someone plz i need it fast ..........
photoshop1234 [79]

Answer:

Do you still need help??

Explanation:

5 0
3 years ago
Read 2 more answers
Tres areas donde se aplica la ciencia y tecnologia
aksik [14]

Possible Answers:

- Medicemanto - Medicine, especially applied.

- Ingeniería - Engineering. Modern scientific engineering is making use of technology to help solve problems and understand cause and effects.

- Comunicación - Communication. Public broadcasting to raise awareness of environmental or other scientific concerns.

7 0
2 years ago
Which symbol is at the beginning and end of a multiline comment block? &amp;&amp;&amp; """ %%% ###
yawa3891 [41]

Answer:

#

Explanation:

I have notes on it we learned it in 8th

7 0
3 years ago
What is the best way to improve an online search
Slav-nsk [51]
Best way is to put your exact question! And do "advanced search"

Hope I helped and if you need more info or another question, then feel free to ask me!
Have a nice day!
6 0
3 years ago
Read 2 more answers
Help me please! (*18* points!)
miss Akunina [59]

Answer:

Databars and Sparkliness are key types of conditional formatting in excel.

Explanation:

Databars show the relative magnitude of values in a dataset. Sparkliness are tiny charts that reside in a cell in excel. These charts are used to show the trend over the time or variation in the dataset.

3 0
3 years ago
Other questions:
  • Achieving a degree in computer forensics, information technology, or even information systems can provide a strong foundation in
    11·1 answer
  • When you enter search keywords in the search box of file explorer and the onedrive option is selected?
    15·2 answers
  • Write a program that takes a date as input and outputs the date's season. The input is a string to represent the month and an in
    6·1 answer
  • Can someone tell me a user to an admin on brainly I got a person sending "inappropriate pictures" all over brainly
    13·1 answer
  • Jabari is writing a program which prompts a user for a value with a decimal. Which function should he use? float() int() print()
    9·2 answers
  • who will follow me on tiktok and like all my videos? if you do ill give branlist and give u a shoutout and you can enter my big
    15·1 answer
  • Which statement best describes what happen to the temoporary working memory (RAM) of a computer when it shut down
    12·2 answers
  • What output is generated by this for loop?
    6·1 answer
  • Explain the main components of a computer system​
    12·1 answer
  • A gui allows you to interact with objects on the screen such as icons and buttons true or false
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!