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
What does raster graphic mean
user100 [1]
Raster graphics are digital images created or captured (for example, by scanning in a photo) as a set of samples of a given space. A raster is a grid of x and y coordinates on a display space. (And for three-dimensional images, a z coordinate.)
6 0
3 years ago
Help please fast
Pachacha [2.7K]
Bookmark because you can go back to it at any given time to re use it
4 0
3 years ago
Read 2 more answers
The inability of BAE Automated Systems to create an automated baggage handling system led to a significant delay in the opening
Sergeu [11.5K]

Answer:

True

Explanation:

Airport was truly opened outside the city of Denver, because of the faults in BAE automated system.

6 0
3 years ago
Custodial workers that access the terminal area must have a fingerprint background check done and training unless they are escor
tensa zangetsu [6.8K]

Answer:

True they do. mark brainliest.!!!!! please

Explanation:

6 0
2 years ago
Wi-Fi Protected Access (WPA) fixes critical vulnerabilities in the earlier wired equivalent privacy (WEP) standard. Understandin
Mars2501 [29]

Since Wi-Fi Protected Access (WPA) fixes critical vulnerabilities in the earlier wired equivalent privacy (WEP) standard, the attacks that is related to encrypted wireless packets is option A: IV attacks.

<h3>Describe an IV attack.</h3>

A wireless network attack is called an initialization vector (IV) attack. During transmission, it alters the IV of an encrypted wireless packet. One packet's plaintext can be utilized by an attacker to calculate the RC4 key stream produced by the IV employed.

Note that A binary vector used to initialize the encryption process for a plaintext block sequence in order to boost security by adding more cryptographic variance and to synchronize cryptographic hardware. The initialization vector is not required to be kept secret.

Learn more about Wi-Fi Protected Access  from

brainly.com/question/13068630
#SPJ1

See full question below

Wi-Fi Protected Access (WPA) fixes critical vulnerabilities in the earlier wired equivalent privacy (WEP) standard. Understanding that WPA uses a combination of an RC4 stream cipher and Temporal Key Integrity Protocol (TKIP), this makes a wireless access point NOT vulnerable to which of the following attacks when related to encrypted wireless packets?

IV attacks

Malware

Ransoware

5 0
1 year ago
Other questions:
  • Mark, David, Tia, and Ashley are team members in a computer programming class. They have been assigned the task of creating a co
    12·1 answer
  • Explain why this scenario points towards a potential problem with BIOS.
    10·2 answers
  • Which type of security software prevents, detects, and removes the malware program that tries to collect personal information or
    8·2 answers
  • Among the second generation home console companies,which managed to come out on top
    10·1 answer
  • Who put forward the idea of nanotechnology to the world?​
    6·1 answer
  • How much is this worth in dollars​
    9·1 answer
  • A desktop computer is a type of mobile device.<br><br> a. true<br> b. false
    5·1 answer
  • In this exercise, you will get some practice with the __add__ method by implementing it for a class called ContactBook. This cla
    12·1 answer
  • Which type of computer is used microprocessor​
    5·1 answer
  • What are the different elements of a window?​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!