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
Print a message telling a user to press the letterToQuit key numPresses times to quit. End with newline. Ex: If letterToQuit = '
LekaFEV [45]

Answer:

#include <stdio.h>

int main(void) {

char letterToQuit = '?';

int numPresses = 0;

printf("Press the %c key %d times to quit ", letterToQuit, numPresses);

return 0;}

Explanation:

in print statement %c is replaced by value of  variable 'letterToQuit'and %d is replaced by value of variable 'numPresses'

3 0
3 years ago
The most commonly used software in the school systems that include word processor, spreadsheet, database management system, and
Irina-Kira [14]
Microsoft office
...........
4 0
4 years ago
Which file format should Wilson use for sending these images?
Nuetrik [128]
I can’t see the answer choices but I would like to say it’s JPEG am not sure. Could you at least provide the answer choices? Thanks!
7 0
3 years ago
Read 2 more answers
what do i do when my mbot is not working but when I plug the cord into the computer it does work but only does one command over
zubka84 [21]
There is probably a default wire out of place or it could be from you yanking the cord out, and doing that wears it down even more.
7 0
4 years ago
Which of the following is true? You are a project manager for Laredo Pioneer's Traveling Rodeo Show. You're heading up a project
nika2105 [10]

Answer: C. You are a project manager for Laredo Pioneer's Traveling Rodeo Show. You're heading up a project to promote a new line of souvenirs to be sold at the shows. You're ready to document the processes you'll use to perform the project as well as define how the project will be executed and controlled and how changes will be monitored and controlled. You are working on the project management plan.

Explanation:

4 0
3 years ago
Other questions:
  • "Currency" is a field data type ,it represents Date or time values<br> True or false tho?
    12·1 answer
  • Write a loop that sets each array element to the sum of itself and the next element, except for the last element which stays the
    15·1 answer
  • Which programming element is used by a game program to track and display score information?
    10·2 answers
  • Write a recursive function that returns 1 if an array of size n is in sorted order and 0 otherwise. Note: If array a stores 3, 6
    6·1 answer
  • :(.
    5·2 answers
  • A boundary marks the inside and outside of a system and sets the system apart from its environment.
    11·1 answer
  • What is the answer to 4.9 Code Practice: Question 2
    14·1 answer
  • When a cpu executes instructions as it converts input into output, it does so with _____.
    8·1 answer
  • Rudy accidentally sent a sensitive work report to a personal friend named James instead one of his co-workers, who is also named
    6·1 answer
  • 1
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!