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
Which guideline should you follow when selecting the font for a presentation
Sladkaya [172]
My school requires us to use Arial and double space it but we have to use font size 30 for title and 24 for the paragraphs.
3 0
3 years ago
The file type blank identifies a word 2013 document
ZanzabumX [31]
Hey there! Hello!

The exclusive file type for Microsoft Word documents is .docx. You can see the attachment showing all the information you need to know about the example Word document I created. As long as you are using Word, the file type will be the same no matter what type of computer you're on or what it's running, so you don't need to worry about it being different for me on Mac than it might be for you on Windows. 

Hope this helped you out! Feel free to ask me any additional questions you may have. :-)

4 0
3 years ago
What term is used to identify the visual interface that displays information it receives from the computer?
olga nikolaevna [1]
The answer to this question is A
7 0
3 years ago
List out two ways to execute the script.​
castortr0y [4]

Answer:

1) Execute Shell Script Using File Name. Use the shell script file name to execute it either by using it's relative path or absolute path as shown below

2) Execute Shell Script Using Source Command.

7 0
2 years ago
Read 2 more answers
Which of the following keys on a keyboard allows you to select multiple cells located in different parts of your worksheet?
MrMuchimi
<span>Hold down the Ctrl key as you click the cells you would like to select.</span>
5 0
2 years ago
Read 2 more answers
Other questions:
  • i got a set of headphones and when i plug them into my speakers the right side only works how do i fix the left side of them
    12·1 answer
  • The first version of the SMTP protocol was defined in RFC 821. The current standard for SMTP is defined in RFC 5321 considering
    11·1 answer
  • How to fix dark images?<br><br>I am using a phone btw​
    14·2 answers
  • list the six external parts or "peripherals" of a computer system and identify which are output and which are input devices.
    15·1 answer
  • How should you mark the query if it is a valid one?
    9·1 answer
  • Why is yo utu be down?<br> (You restrict talking about yo utu be, really)
    11·2 answers
  • Mha lovers why do other anime lovers report mha lovers for not liking there anime?
    6·2 answers
  • A sensitive manufacturing facility has recently noticed an abnormal number of assembly-line robot failures. Upon intensive inves
    10·1 answer
  • All _______ that store more than one piece of data ​
    12·1 answer
  • One limitation of high-level programming languages is
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!