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
Nancy needs to find the average of two numbers in the middle from an even count of numbers arranged in descending order. which s
Rus_ich [418]

i would say e. the median

7 0
3 years ago
Read 2 more answers
Which of the following statements is true of subroutines? Check all that apply.
erica [24]
I believe it’s the first answer

“They can be used in multiple places “

But I’m not sure!!
6 0
3 years ago
Read 2 more answers
When you adopt a certain framework or strategy for solving a series of problems, you may fail to see other, more efficient ways
Olegator [25]
I believe it is called closed mindset. Closed mindset is when you fail to see other ways to your error and don't accept help or think you can improve.
7 0
4 years ago
How many passes will it take to find the four in this list?
Vaselesa [24]
I don’t know what the heck is it true
3 0
3 years ago
Read 2 more answers
Select the correct answer.
zmey [24]

Answer: data design model

Explanation:

8 0
3 years ago
Other questions:
  • Alicia would like to make important text in her spreadsheet stand out. Alicia should _____
    8·2 answers
  • The indent buttons on the home tab allow you to increase or decrease paragraph indenting in increments of ____ inches.
    5·1 answer
  • The Start menu on Windows computers changes based on actions performed by their users. True False
    15·2 answers
  • How to transfer photos from lg tablet to computer?
    15·1 answer
  • Best free vpn to bypass geo tagging
    5·1 answer
  • (1) Output a menu of automotive services and the corresponding cost of each service. (2 pts)Ex:Davy's auto shop servicesOil chan
    9·1 answer
  • Write a function which sorts the queue in order from the smallest value to the largest value. This should be a modified version
    5·1 answer
  • Which of the following is not an example of debugging? looking for errors in programming code. fixing misspelled commands in pro
    13·1 answer
  • The Synonyms submenu offers a list of synonyms for a word. Is it always a good idea to use whatever synonyms are presented on th
    15·1 answer
  • Q.3.1 Explain why devices on a network need addresses. (5)​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!