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
White raven [17]
3 years ago
5

Complete function PrintPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 2, print "To

o small". If greater than 10, print "Too large". Otherwise, compute and print 6 * bagOunces followed by " seconds". End with a newline. Example output for ounces.1 #include 2 using namespace std; 34 void PrintPopcornTime (int bagOunces)5 6 Your solution goes here 10 int main) 7891011 PrintPopcornTime(7) 12 13 return 0 14
Computers and Technology
1 answer:
Ludmilka [50]3 years ago
4 0

Answer:

#include <iostream>

using namespace std;

void PrintPopcornTime (int bagOunces){

   if (bagOunces < 2){

       cout << "Too small"<<endl;

   }

   else if (bagOunces > 10){

       cout << "Too large"<<endl;

   }

   else{

       cout << bagOunces*6 <<" seconds"<<endl;

   }

}

int main(){

   PrintPopcornTime(7);

   

   return 0;

}

Explanation:

Create a function called PrintPopcornTime that takes one parameter, bagOunces

Check the bagOunces using if-else structure. If it is smaller than 2, print "Too small". If it is greater than 10, print "Too large". Otherwise, calculate and print 6*bagOunces followed by " seconds".

Call the function in the main function with parameter 7. Since 7 is not smaller than 2 or not greater than 10, "42 seconds" will be printed.

You might be interested in
Which of the following OSI layers is responsible for the segmentation, multiplexing, flow control and host-to-host communication
Lisa [10]

Answer:

Transport Layer

Explanation:

The transport layer which is responsible for end-to-end communication over a network. Transport Layer breaks the data, allocated by Application layer in smaller units called segments. It is used to number every byte in the segment. It is also responsible for error correction and provides reliability to the user. It allows the host to send and receive error corrected data, messages or packets  over a network and ensures  that data should be received in the same sequence in which it was sent.  It also enables multiplexing and flow control.

7 0
3 years ago
Which of the following function declarations correctly expect an array as the first argument?
NARA [144]

Answer:

Only

Option: void f1(float array[], int size);

is valid.

Explanation:

To pass an array as argument in a function, the syntax should be as follows:

functionName (type arrayName[ ] )

We can't place the size of the array inside the array bracket (arrayName[100]) as this will give a syntax error. The empty bracket [] is required to tell the program that the value that passed as the argument is an array and differentiate it from other type of value.

3 0
3 years ago
How to improve and create beautiful graphic
kaheart [24]

Answer:

Learn OpenGL and any graphics rendering program.

Explanation:

3 0
3 years ago
What is 9 - 3 ÷ 1/3 + 1 = ?
Ainat [17]
The answer is 9
Hope I helped you
6 0
3 years ago
Read 2 more answers
A retail store stocks two types of shirts A and B. These are packed in attractive cardboard boxes. During a week the store can s
antiseptic1488 [7]
300 of A and 300 of b
7 0
2 years ago
Other questions:
  • Can your computer become infected with a virus via email
    10·1 answer
  • A layer of control in each communicating device that provides functions such as flow control, error detection, and error control
    13·1 answer
  • Name the contributions of Steve Jobs and Bill Gates, with respect to technology.
    5·1 answer
  • Which tab on the Chart Tools Contextual tab will contain commands that are used to change the style of charts and to edit chart
    12·2 answers
  • Are you allowed to copy and paste answers on brainy to give answers to other people?
    5·2 answers
  • graphic designers can compress files in different formats . One of the formats ensures that the quality and details of the image
    7·1 answer
  • Use the drop-down menus to complete the statements about using column breaks in word 2016
    6·2 answers
  • Maria needs to use a requirement-gathering method that will help her provide a set of questions to the client. Which method shou
    11·1 answer
  • The math function ceil(x) returns the smallest integer that is greater than or equal to x. True False
    12·1 answer
  • The unit we use to measure bending moment is...<br> A kg<br> B N<br> C Nm<br> D MPa
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!