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
What are the first two models, e.g. diagrams that affect the entire system, that are built during the CoreProcess to discover an
mrs_skeptik [129]

Answer:

The answer is "Option c and Option d".

Explanation:

A diagram for a case use is a UML dynamic or computational diagram, that is used in the case diagram model. It consists of a set of actions, services, and functions to be carried out by the system. and The class diagram refers to relationships between the UML classes and the source code that dependence, that is two diagrams that affect the system and others are wrong, which can be explained as follows:

  • In option a, It is used for business process, that's is not correct.
  • In option b, It is used for both professionals industry like software and business, that's why it is wrong.
  • In option e, It is used in only high-level language, that's why it is wrong.
  • In option f, It is used to adjust its layout that's why it is wrong.

3 0
4 years ago
PSEUDOCODE PRACTICE!!! NEED HELP IMMEDIATELY!!! FIRST ANSWER GETS BRAINLYEST!!!
iogann1982 [59]

Answer:

a-nothing b-3 c-9 d-1

Explanation:

5 0
3 years ago
Who plays rocket league?
Rashid [163]

Answer:

I dont

Explanation:

8 0
3 years ago
Read 2 more answers
??????????????????????????
suter [353]

Answer:

procedimento

Explanation:

faz se a montagem conforme mostra a figura.

6 0
3 years ago
Which of the following may present a problem for Linux users?
motikmotik
Tendancy to crash hope that helped
6 0
3 years ago
Read 2 more answers
Other questions:
  • What does the security element of non-repudiation mean in e-commerce cybersecurity? A. Data needs to be available at all times.
    10·1 answer
  • _____ are unique identifiers of computer or network addresses on the internet.
    6·2 answers
  • During college jesse spent four semesters studying abroad in other parts of the world how could jesses time abroad benefit his e
    5·2 answers
  • The emergence of MP3 (iPod) technology is an example of creative destruction because a. It is less expensive than compact discs
    14·1 answer
  • Which of the following is not a compilation error? Group of answer choices a. Placing a semicolon at the end of the first line o
    13·1 answer
  • IPv6 is being developed in order to:
    15·1 answer
  • The difference between the Basic Image Editing Software and Advance Image Editing Software.
    14·1 answer
  • Is orgenized maningful and useful data​
    15·1 answer
  • The current in a resistor is 5.0 A, and its power is 60 W. What is the voltage?
    12·2 answers
  • Harry needs to make a presentation on packaging prototypes for a new product. Which presentation software elements can be use to
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!