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]
4 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]4 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
1
max2010maxim [7]

Answer:Go to the location where you want to save the file.

Explanation:

8 0
4 years ago
A sinewave has a period (duration of one cycle) of 645 μs. What is the corresponding frequency of this sinewave, in kHz, express
irga5000 [103]

The corresponding frequency of this sinewave, in kHz, expressed to 3 significant figures is: <em>155 kHz.</em>

<u>Given the following data:</u>

  • Period = 645 μs

Note: μs represents microseconds.

<u>Conversion:</u>

1 μs = 1 × 10^{-6} seconds

645 μs = 645 × 10^{-6} seconds

To find corresponding frequency of this sinewave, in kHz;

Mathematically, the frequency of a waveform is calculated by using the formula;

Frequency = \frac{1}{Period}

Substituting the value into the formula, we have;

Frequency = \frac{1}{645\; * \;10^{-6}}

Frequency = 1550.39 Hz

Next, we would convert the value of frequency in hertz (Hz) to Kilohertz (kHz);

<u>Conversion:</u>

1 hertz = 0.001 kilohertz

1550.3876 hertz = X kilohertz

Cross-multiplying, we have;

X = 0.001 × 1550.39

X = 155039 kHz

To 3 significant figures;

<em>Frequency = 155 kHz</em>

Find more information: brainly.com/question/23460034

5 0
3 years ago
Gary frequently types his class assignment. His ring automatically types the letter O. What is Gary using when he types?
Solnce55 [7]
The answer would be C
8 0
4 years ago
Read 2 more answers
Which one of the following statement is untrue
aev [14]

Answer:

B IS FALSE

Explanation:

they are input devices

3 0
3 years ago
What is it about Pinterest that makes it a good platform for ecommerce sites?
Inga [223]
With the large variance of items on the site it is easy to invest in an idea
5 0
3 years ago
Read 2 more answers
Other questions:
  • Nevermind- I figured it out.
    14·1 answer
  • Is cheque money? give reason​
    9·1 answer
  • A new company will have 40 workstations in one building sharing a single network. All users must be able to share files and prin
    9·1 answer
  • What will save you the most money when trying to reduce the cost of college
    5·2 answers
  • Write a program that reads in the following data, all entered on one line with at least one space separating them: a) an integer
    13·1 answer
  • Unicode is a world standard to represent _________________
    10·1 answer
  • How much memory will be occupied by black and white image​
    8·2 answers
  • How do ACLs work on a router?
    14·1 answer
  • What is analog computer?​
    14·1 answer
  • Lesson 2.7 Code Practice #2
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!