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
Imagine the deep, low sound made by a tuba. Now, what is an example of a sound with a much higher pitch?
goblinko [34]
B.) The rumble of thunder.
I hope this helps. :p
7 0
3 years ago
Read 2 more answers
What is that black thing on my wall?
Darya [45]
I'm guessing your television if it's a flat screen
7 0
3 years ago
All of the following are benefits of automation except
Tasya [4]

Question 1:

4. it increases the number of employees

Question 2:

2. false

Question 3:

2. it causes great damage to the ozone layer

Question 4:

1. true



6 0
3 years ago
What is NOT powered by the PSU of your computer?
Yuliya22 [10]
Peripherals like your monitor or your printer.
3 0
3 years ago
Daphne has determined that she has malware on her linux machine. She prefers to only use open-source software. Which anti-malwar
Llana [10]

Answer:

ClamAV is the open source antivirus you can in your Linux machine.

5 0
2 years ago
Other questions:
  • Josie, your best friend, is having a huge Sweet Sixteen party. She has designated you to address all 100 of the envelopes (using
    7·1 answer
  • The programs that provide the infrastructure and hardware control necessary for the computer and its peripheral devices are call
    11·1 answer
  • Software engineering design teams use ________, which are grounded in mathematical concepts of sets and relations, for their sof
    13·1 answer
  • Write a static method named anglePairs that accepts three angles (integers), measured in degrees, as parameters and returns whet
    10·1 answer
  • Why is democracy the best form of government
    5·1 answer
  • How should font appear in a slide presentation compared to the font in a document
    7·1 answer
  • Charts are more effective in attaining attentionthen others methods of presenting data. Do you agree?
    10·1 answer
  • When Russ opened a website on his browser, he saw an error that the site was not compatible with the browser version he was runn
    9·1 answer
  • Which statement gives an advantage of multicellular organisms?
    7·2 answers
  • Who is on ig and would like to be friends?​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!