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
I'm using my PS4 dual shock controller to connect to the fire stick on the tv so I can play games with it but whenever I try to
Mazyrski [523]
Well i'm not gonna suggest you unpiecing your device because you sir probably lack the skills of doing so but what i will suggest to you is to press your share button and you p playstation button at the same time for at least a minute than try charging it again if that solution does work i would advise tring to unopiece the device but by doing carefully and slowly and remembering where each pieces are staying and i want you to take out the eos system and putting it back in and then piece back together and if that solutiuon doesn't work call playstation or email them or go ahead and go and try to repair it or you can  go and BUY A NEW CONTROLLER. hope i helped have a good day bro.
4 0
3 years ago
Digital citizenship is both a right and a {Blank}.
wolverine [178]
Privilege, I believe.
Hope this helps!<span />
6 0
3 years ago
Read 2 more answers
In a social networking site your personal information is listed under your?
abruzzese [7]
Profile? Perhaps... If you go on social media sites like Facebook it's typically on your profile, right?
3 0
3 years ago
Read 2 more answers
How do i confirm my email address on here
Ipatiy [6.2K]
Hi you go to your email and press confirm and it will come back here to this site and it will auto confirm.
7 0
3 years ago
Read 2 more answers
You must obey any special signs or instructions as you pass a construction zone.
valkas [14]
That is easy it is a
5 0
3 years ago
Read 2 more answers
Other questions:
  • Keion works as a freelancer creating websites and designing logos for clients. He recently had a hard drive failure and lost wor
    7·1 answer
  • 4. An outline is most like which of the following? (1 point)
    14·1 answer
  • If you will be giving your presentation to an audience, you can practice your presentation by using View, ___________, to rehear
    14·1 answer
  • Choose the type of collection described.
    9·1 answer
  • Which common online presentation medium do people use to present their own articles?
    8·2 answers
  • Is anyone a robIox moderator?
    13·2 answers
  • Miley met up with a bunch of her college friends after several years. She told them that she works for the sound department of a
    5·1 answer
  • I will mark you as brainlist
    10·2 answers
  • What happened to the ten commandments tablets.
    9·1 answer
  • True of false that the memory of laptop is normally measured in kilobytes
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!