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]
2 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]2 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
A fast food chain that wants to inform consumers about its latest dollar menu item will most likely use ___ to do so. ____ may i
Eva8 [605]
The correct answer is 1: B new tech and 2:C we can tell by the way businesses are incorporating things like social media like how Wendys got more popular because of their sassy tweets
3 0
3 years ago
Read 2 more answers
Write the function "zipper". the function will take two array/list/table parameters and return a new array/list/table which will
MakcuM [25]
What is the problem what am I supposed to do?
4 0
3 years ago
What is the output of doublec= 12.0 / 5 Systemoutprintln (c)
artcher [175]

Answer:

The code will produce:-

2.4

Explanation:

In this code the result of the arithmetic operation is stored in the variable c.On evaluating the expression it divides 12.0 by 5 which results in 2.4 and it is stored in float variable c.Then it is printed on the screen using print statement.Since the c is double variable so the result will be a decimal number.

Hence the answer is 4.

6 0
3 years ago
Which of the following is a preferable method to secure wireless access in a SOHO?
NARA [144]
Use a Ghost program follow throught with 2hyttlg5:6\:56
6 0
3 years ago
Which feature of spreadsheet software can display numerical data in a visually appealing and easily understood format
Bad White [126]
A table maker makes visually appealing tables such as line graphs, bar graphs, venn diagrams on a spreadsheet software. 
8 0
3 years ago
Read 2 more answers
Other questions:
  • Tomi is testing all of the links on her web page by clicking on each one in a browser. What type of testing is this considered?
    6·2 answers
  • You are preparing to program a replacement system board, but the "system is booting in mpm mode" message is not displayed. what
    10·2 answers
  • What is the correct process for inserting a blank worksheet in Google sheets
    12·1 answer
  • Write a Temperature class that will hold a temperature in Fahrenheit, and will provide methods to get and display the temperatur
    5·1 answer
  • Jennifer recently bought a new computer to type a new manuscript she’s been working on. She also stored a lot of movies on it to
    10·1 answer
  • Insert a function in cell g5 to calculate the first student's monthly payment, using appropriate relative and absolute cell refe
    13·1 answer
  • Which of the following is the MOST sensitive Personally Identifiable Information (PII) and should be shared cautiously and only
    8·1 answer
  • How do i use a computer (i'm 99999 years old)
    8·2 answers
  • What is a key differentiator for Accenture when delivering Artificial Intelligence (AI) solutions to clients?
    11·1 answer
  • Kelly wants to change the text in a cell so that it is centered instead of left-aligned, where should she look to make this
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!