answer.
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
Maru [420]
1 year ago
8

Define function print_popcorn_time() with parameter bag_ounces. If bag_ounces is less than 3, print "Too small". If greater than

10, print "Too large". Otherwise, compute and print 6 * bag_ounces followed by "seconds". End with a newline. Remember that print() automatically adds a newline.
Computers and Technology
1 answer:
Furkat [3]1 year ago
3 0

Answer:

In Python:

def print_popcorn_time(bag_ounces):

   if bag_ounces < 3:

       print("Too small")

   if bag_ounces > 10:

       print("Too large")

   else:

       print(str(6 * bag_ounces)+" seconds")

       

Explanation:

This defines the function

def print_popcorn_time(bag_ounces):

This checks if bag_ounces < 3

   if bag_ounces < 3:

If yes, it prints too small

       print("Too small")

This checks if bag_ounces > 10

   if bag_ounces > 10:

If yes, it prints too big

       print("Too large")

If otherwise,

   else:

Multiply bag_ounces by 6 and print the outcome

       print(str(6 * bag_ounces)+" seconds")

You might be interested in
Explain why each of the following names does or does not seem like a good variable name to represent a state sales tax rate.
tatyana61 [14]

a. stateTaxRate  - A good variable name because it represents what it holds, the state sales tax rate, without being too wordy. Also correctly capitalized in camelcase.

b. txRt  - A bad variable name because while short and simple, it is too hard to understand what the variable represents.

c. t  - A very bad variable name if you plan on using the variable often. Far too short and you will forget what it represents and is needed for.

d. stateSalesTaxRateValue  - A bad variable name because it is just too wordy. Cutting it down to A's variable name is much more reasonable

e. state tax rate  - A bad variable name and probably invalid because it has spaces in the name.

f. taxRate  - A good variable name if there are no other tax calculations other than state tax rate. Otherwise you would confuse state vs local tax rate or something, making it a bad variable name.

g. 1TaxRate  - A bad variable name because the number 1 has no reason being in the variable name. It doesn't add anything to the name.

h. moneyCharged - A bad variable name because it is not specific enough in explaining why the money is being charged and what for.

7 0
2 years ago
Assuming that the list newAnimals is initially empty, what would this list contain after the following code segment is run?
allochka39001 [22]

Answer:

b

Explanation:

4 0
2 years ago
Read 2 more answers
Which of the following reflects Moore's law? Multiple Choice The doubling of computer chip performance per dollar every two year
Katena32 [7]

Answer:

The correct answer is A.

Explanation:

Moore's Law states/predicts that the maximum number of transistors that can be used on integrated circuits (processors etc.) will be doubled every two years so it basically predicts an exponential growth in terms of transistors used.

Doubling the number of transistors used means that it will almost certainly increase the performance of the processors. Of course there are a lot of other variables that the performance depends on but Moore's Law is proven to be true and  is being used since 1960's. The answer given in option A is the one that best reflects on this law.

I hope this answer helps.

4 0
1 year ago
Audio tools support reading fluency by
Artist 52 [7]

Answer:

The answer is "demonstrating how a text is read".

Explanation:

Audio tools like Text to Speech are commonplace in programs like Duolingo. They offer you a somewhat accurate example of how to properly pronounce a word or phrase.

4 0
2 years ago
Read 2 more answers
"the file that specifies how netbeans builds and deploys the application when you run the application is called the ____________
katen-ka-za [31]
Called the<span>. </span>script<span>. build. When you run a web application, NetBeans. automatically compiles all the files that need to be compiled, deploys th</span>
5 0
1 year ago
Other questions:
  • List three functions that you can perform with a database that you cannot perform with a spreadsheet.
    11·1 answer
  • Each frame is composed of a number of colors recorded in digital format; we call these pixels. What information does the number
    15·1 answer
  • Which selections are possible for controlling the start time of audio playback? Check all that apply. Automatic Rewind when done
    10·1 answer
  • Which key retains its uniqueness even after you remove some of the fields?
    14·1 answer
  • "online privacy alliance (opa) is an organization of companies dedicated to protecting online privacy. members of opa agree to c
    15·1 answer
  • A user complains that her computer is performing slowly. She tells you the problem started about a week ago when new database so
    15·1 answer
  • Suppose that the data mining task is to cluster points (with (x, y) representing location) into three clusters, where the points
    14·1 answer
  • 12) Suppose you wanted a subroutine to return to an address that was 3 bytes higher in memory than the return address currently
    11·1 answer
  • Does the submission include the file "SuperPower.java"? Does the file include a public class called "SuperPower"? Does the class
    13·1 answer
  • When authenticating a user's password, the password supplied by the user is authenticated by comparing the ____ of the password
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!