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
Which was the first wiki based website
stira [4]
WikiWikiWeb was the first made by <span>Cunningham.</span>
5 0
3 years ago
Read 2 more answers
“What does it mean when we “rework” copyrighted material?”
Alja [10]
We use ideas and thoughts that have already been protected by the law which is called Copyright. We reworking copyright material means we are taking somebody's ideas and calling it ours. Which is not right by the law.
3 0
3 years ago
Read 2 more answers
Question # 4
natka813 [3]

Answer:

class

Explanation:

edg2020

4 0
3 years ago
A finance company wants to upgrade its accounting software to a higher version. This version change requires a change in data fo
Alina [70]

Answer:

The answer to this question is option b which is data re-engineering.

Explanation:

In computer science, data re-engineering is a part of the software development life cycle(SDLC). In the SDLC the data re-engineering is a technique that provides the facility to increase the size of the data formats, design,data-view, etc. It is also known as the software development process in this process, there are seven-stage for software development. If we want to upgrade the software to use the data re-engineering technique so we used the software development process. We use only this process to develop the software because there is no other process to development. So the correct answer is data re-engineering

4 0
3 years ago
Read 2 more answers
If a system's instruction set consists of an 8-bit opcode, what is the maximum number of output signal lines required for the co
otez555 [7]

Answer:

D. 256

Explanation:

Given

Instructions = 8\ bit

Required

Determine the maximum number of output

To get the required value, we make use of the following:

Maximum = 2^n

Where n is the bits of the opcode.

i.e.

n = 8

Substitute 8 for n in Maximum = 2^n

Maximum = 2^8

Maximum = 256

<em>Hence, option D answers the question</em>

6 0
3 years ago
Other questions:
  • The most efficient way to perform data entry is to keep your hands on the keyboard and press _______ to move to the next cell in
    14·1 answer
  • Write a program that generates two 3x3 matrices, A and B, withrandom values in the range [1, 100] and calculates the expression½
    11·1 answer
  • Please check my answer! (Java)
    13·1 answer
  • Can anyone find any words in here?
    14·2 answers
  • Create a program that includes a function called toUpperCamelCase that takes a string (consisting of lowercase words and spaces)
    9·1 answer
  • Whats a field in databases?
    5·1 answer
  • HELP ASAP 10 POINTS COMPUTER SCIENCE
    14·2 answers
  • A list is sorted in ascending order if it is empty or each item except the last one is less than or equal to its successor.
    14·1 answer
  • Change the following sentences using 'used to
    12·1 answer
  • If an if-else statement is true, it will include which kinds of results?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!