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
SVETLANKA909090 [29]
3 years ago
14

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.
Computers and Technology
2 answers:
yawa3891 [41]3 years ago
8 0

Answer:

void print_popcorn_time(int bag_ounces){

   if(bag_ounces < 3){

       cout<<"Too small"<<endl;

   }else if(bag_ounces > 10){

       cout<<"Too large"<<endl;

   }else{

       cout<<(6 * bag_ounces)<<"seconds"<<endl;

   }

}

Explanation:

The function is the block of the statement which performs the special task.

For checking the condition in the program, the if-else statement is used.

It can check the condition one or two but if we want to check the more than two different conditions then the continuous if-else statement is used.

syntax of continuous if else:

if(condition){

statement;

}else if(condition)

statement;

}else{

statement;

}

In the question, there are three conditions;

1. bag_ounces is less than 3

2. bag_ounces greater than 10

3. else part.

we put the condition in the above if-else statement and print the corresponding message.

erastova [34]3 years ago
5 0

Answer:

def print_popcorn_time(bag_ounces):

   if bag_ounces < 3:

       print("Too small")

   elif bag_ounces > 10:

        print("Too large")

   else:

        bag_ounces = bag_ounces * 6

        print(bag_ounces, "seconds")

Explanation:

def print_popcorn_time(bag_ounces): #fed function

   if bag_ounces < 3:  #1st if statement

       print("Too small") #print function

   elif bag_ounces > 10: #else if

        print("Too large") #print than print

   else:  #else:

        bag_ounces = bag_ounces * 6 #do work

        print(bag_ounces, "seconds") #print

You might be interested in
Early word processors ran on devices that look like digital
S_A_V [24]

Answer:

True

Explanation:

The word processor used to be the only office machine in the year 1960s, that combined the keyboard text-entry and various printing functions of an electric typewriter with the recording memory. And this recording unit was a tape or a floppy disk, with the simplest of processor applied for text editing. Hence, the above statement that the early word processors ran on the devices that look like digital is true.

6 0
3 years ago
Read 2 more answers
What color typically indicates the speaker port on a sound card?
allsm [11]
The answer to this question would be: Lime green

The lime green color code is for audio output for speaker or headphones. Color coding is greatly helpful to make sure that the port you are using is correct. Using the color you can determine what kind of input or output the port is for. There is a few others color coding like pink for analog microphone input, or light blue for audio input of analog line.
4 0
3 years ago
Read 2 more answers
A “greedy algorithm” sometimes works well for optimization problems???
mrs_skeptik [129]
An optimization problem is one in which you want to find, not just a solution, but the best  solution •<span>A <span>“greedy algorithm” sometimes works </span></span><span>well for optimization problems </span>•<span>But only a few optimization problems can </span><span> be solved by the <span>greedy method</span></span>
5 0
3 years ago
Why is it helpful that the ribbon tabs can collapse?
Verizon [17]
<span>The 'Pin the ribbon' button replaces the 'Collapse the Ribbon' button when the ribbon is collapsed. You will see the 'Pin the ribbon' button only when you expand a ribbon by tapping or clicking a tab.</span>
4 0
3 years ago
#Write a function called grade_scantron. grade_scantron should
NARA [144]

En este ejemplo vemos que, por la información dada, no es posible que esta oración tenga coherencia o sentido. En este caso el nexo o conector que une ambas oraciones no debería haberse utilizado, puesto que ambas oraciones no tienen relación. Por ende corresponden a estructuras diferentes y no es posible que mantengan una coherencia. Varias oraciones sin coherencia, generan textos incoherentes.

4 0
3 years ago
Other questions:
  • What is security in Technology<br>​
    8·2 answers
  • Deterime the minimum number of multiplication operations needed to compute the following. Show the order of the computations.
    10·1 answer
  • What can help prevent issues related to downloading content from the internet?
    7·1 answer
  • F a domain consists of dcs that are running verions of windows server earlier than windows server 2008, what replication method
    10·1 answer
  • To a traditional computer, one means
    8·1 answer
  • which one of the following word process feature saves you the most time when you keying in a document
    9·1 answer
  • i set up an account and paid the yearly fee, now it's asking me to join. i've tried to log in and brainly isn't accepting my ema
    8·1 answer
  • If you copy and paste from someone else's document (such as a website, a friend's paper, an instructor's solutions manual, etc.)
    15·1 answer
  • ¿Cuáles aspectos serían los que más incidirían para que no se pudiera cumplir con el principio de imparcialidad en una auditoría
    11·1 answer
  • When you are typing data that is in a series, such as days of the week or months of the year, you can use this tool to complete
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!