answer.
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
Zolol [24]
2 years ago
12

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.

Computers and Technology
2 answers:
Sati [7]2 years ago
3 0

Answer:

The program to this question as follows:

Program:

#include <iostream> //defining header file

using namespace std;

void PrintPopcornTime(int bagOunces) //defining method PrintPopcornTime that accepts bagOunces

{

//defining conditional statement

if (bagOunces < 3) //if block checks bagOunces less then 3  

{

cout << "Too small"<<endl;

}

else if (bagOunces > 10)

{

cout << "Too large"<<endl; //else if value greater than 10

}

else //else block

{

cout << (bagOunces*6) <<" seconds"<<endl; //calculate seconds

}

}

int main()  

{

int bagOunces; //defining integer variable bagOunces

cout<<"Enter number: "; //message

cin>>bagOunces; //input value by user

PrintPopcornTime(bagOunces); //calling the method

return 0;

}

Output:

Enter number: 3

18 seconds

Explanation:

In the above C++ language code, the first header file is defined, then the method "PrintPopcornTime" is defined, in this method, an integer variable "bagOunces" is passed as a parameter, inside the method a conditional statement is used that can be described as follows:

  • In the if block, it will check that the "bagOunces" variable value is less than 3, if it is true, it will print "Too small". otherwise, it will go else if block.
  • In else if the "bagOunces" variable value is greater then 10, if it is true, it will print "Too large", otherwise it will go else block.
  • In the else block it will calculate the total second and prints its value in new line.

In the next step, the main method is defined, inside this method, an integer variable "bagOunces" is defined, which is used for user input and inside this method, the PrintPopcornTime is called.

charle [14.2K]2 years ago
3 0

Answer:

if(bagOunces < 2){

      System.out.println("Too small");

  }

  else if(bagOunces > 10){

      System.out.println("Too large");

  }

  else{

      System.out.println(6*bagOunces+" seconds");

  }

Explanation:

You might be interested in
During college jesse spent four semesters studying abroad in other parts of the world how could jesses time abroad benefit his e
Yuliya22 [10]

Information technology is more global than other fields. Jesse's diverse college background could help him remain culturally sensitive during communications with collaborators from other parts of the world.

4 0
2 years ago
Read 2 more answers
Access to sensitive or restricted information is controlled describes which of the key communications and information systems pr
Viktor [21]

Answer:

C: Security

Explanation:

Communications and information systems principles need to be, among other things, secure. They need to be able to protect sensitive information from those who intentionally not need to know. Some incident information like voice, networks, and data, are very sensitive and thus, should be secure to the right levels and should comply with privacy laws and data protection.

4 0
2 years ago
Sang ayon kaba sa pahayag na walang sinuman ang nabubuhay para sa sarili lamang? bakit?
d1i1m1o1n [39]
What language is this?
7 0
2 years ago
Brandon purchased a new processor online as an upgrade. When he purchased the processor, he made sure that it used the same sock
Sergio039 [100]

D. You will not be able install the processor in the wrong motherboard.

<u>Explanation:</u>

Brandon before buying any microprocessor for upgrading in the mother board, Brandon has to take care of following things

1. Whether upgrade is possible, if possible where mother supports or not

2. Pick socket combination is correct or not.

3. After upgrading the microprocessor, Brandon has to check whether voltage and cooling fans fit in the same space in the mother board.

4. Whether existing ram type supports or not.

5. Sometimes once fixed removing upgrading microprocessor will damage the mother board.

Since Brandon has already concluded motherboard chipset compatibility is not been checked.

7 0
2 years ago
This program finds the sum and average of three numbers. What are the proper codes for Lines a and b?
Gennadij [26K]

Answer:

The Proper codes in Line a and Line b is given below

average=Sum/3  

print (" Average is = ", average)

Explanation:

In the given question it calculated the sum but the program does not calculate the average of the 3 numbers.The average of the 3 number is calculated by using average=Sum/3   statement so we add this code in Line a then After that print the value of average by using the print function so we add this code in Line b.

4 0
2 years ago
Read 2 more answers
Other questions:
  • What is a cursor?
    6·2 answers
  • Which are examples of intrapersonal goals? Check all that apply. Lea plans to finish her next project before the due date. Erick
    12·2 answers
  • Judd puts password protection on all of his files, makes sure not to have any patient information open on his computer when he t
    12·2 answers
  • Import java.util.scanner; public class sumofmax { public double findmax(double num1, double num2) { double maxval; // note: if-e
    10·1 answer
  • When you park on a hill, think about which way _____.
    6·2 answers
  • Implement a class MyInt() that behaves almost the same as the class int, except when trying to add an object of type MyInt. Then
    11·1 answer
  • "In about 100 words, discuss the technologies that Walmart’s trucking fleet might use to better manage their operations. Include
    7·1 answer
  • Raj, a recent graduate, has recently joined your organization as a Junior Business Analyst. He has been asked to conduct a Feasi
    11·1 answer
  • Refer to the exhibit. The PC is connected to the console port of the switch. All the other connections are made through FastEthe
    6·1 answer
  • Write a function named max that accepts two integer values as arguments and returns the value that is the greater of the two. Fo
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!