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
telo118 [61]
3 years ago
7

Using C++, complete function PrintPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 2

, print "Too 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 = 7:42 seconds1 #include 2 using namespace std; 34 void PrintPopcornTime(int bagOunces) { 56 /* Your solution goes here */ 78 } 9 int main() { 10 int userOunces; cin >> userOunces; 11 PrintPopcornTime12 13 return 0; 14 }
Computers and Technology
1 answer:
victus00 [196]3 years ago
3 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 << 6 * bagOunces <<" seconds" << endl;

}

int main()

{

   int userOunces;

   cin >> userOunces;

   PrintPopcornTime(userOunces);

   return 0;

}

Explanation:

Inside the function PrintPopcornTime, check the parameter bagOunces using if structure. Depending on the value of bagOunces, print the required information.

Inside the main, ask the user for the userOunces. Call the PrintPopcornTime function with the userOunces.

You might be interested in
How does violating the SOLID principles make code hard to test?
Kamila [148]

Answer:

SOLID is the acronym form of the first five principle of object oriented programming. It basically provide the high cohesive units and used in the testing purpose. The SOLID principle combined together to develop a software easily and it is easy to maintain.

By applying the SOLID principle it makes easy to understand it also provide the better quality in the software. Therefore, violating the SOLID principle it become difficult the code to test.

4 0
2 years ago
IF YOU COULD CREATE A SOCIAL NETWORK:, what would it be like? What would make it so special about the others? (If you want you c
frosja888 [35]

It would be like instagram

3 0
3 years ago
Online library catalogs can direct you to your closest library. (1 point)<br> True<br> False
Kitty [74]

Answer:

True

Explanation:

8 0
3 years ago
The objects that you place on master pages are called _____.
Studentka2010 [4]
The answer to this is A.
3 0
3 years ago
What does core mean? what are they for?​
xeze [42]

Answer:

what does core mean? what are they for?​

Explanation:

A core is located inside the CPU its the part that gives instructions to software to preform a certain task, the more cores, the faster software can preform a task

4 0
3 years ago
Other questions:
  • Write a program that calculates an adult's fat-burning heart rate, which is 70% of 220 minus the person's age. Complete fat_burn
    10·1 answer
  • When you create a new slide in a presentation program, you are promoted to choose a placeholder. True or false?
    11·2 answers
  • Jenny is working on a laptop computer and has notices that the computer is not running very fast. She looks and realizes that th
    6·2 answers
  • What is a Hard Drive
    13·1 answer
  • if anyone is on a Chromebook, do you ever mean to press backspace, then you accidentally press the power button and think "OH CR
    13·2 answers
  • Write a function solution that, given an array A consisting of N integers, returns the number of fragements of A whose sum equal
    9·1 answer
  • Anyone trying to play fortnite ? im bored lol
    6·2 answers
  • My messaging system is messed up. It keeps saying I'm getting messages but then it says nothing new in my inbox. I'm confused- H
    15·2 answers
  • WHAT IS A GOOD APP FOR REMOVING VIRUSES AND IT YOU DONT HAVE TO PAY MUCH FOR IT ????? PLEASE HELP ME
    8·2 answers
  • WILL GIVE BRAILIEST
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!