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
mixer [17]
3 years ago
15

Define function print_popcorn_time() with parameter bag_ounces. If bag_ounces is less than 3, print "Too small". If greater than

10, print "Too large". Otherwise, compute and print 6 * bag_ounces followed by "seconds". End with a newline. Sample output with input: 7 42 seconds
Computers and Technology
1 answer:
Gnoma [55]3 years ago
3 0

Answer:

public static void print_popcorn_time(int bag_ounces){

       if(bag_ounces<3){

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

       }

       else if(bag_ounces>10){

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

       }

       else{

           bag_ounces*=6;

           System.out.println(bag_ounces+" seconds");

       }

   }

Explanation:

Using Java prograamming Language.

The Method (function) print_popcorn_time is defined to accept a single parameter of type int

Using if...else if ....else statements it prints the expected output given in the question

A complete java program calling the method is given below

public class num6 {

   public static void main(String[] args) {

       int bagOunces = 7;

       print_popcorn_time(bagOunces);

   }

   public static void print_popcorn_time(int bag_ounces){

       if(bag_ounces<3){

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

       }

       else if(bag_ounces>10){

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

       }

       else{

           bag_ounces*=6;

           System.out.println(bag_ounces+" seconds");

       }

   }

}

You might be interested in
A ________ is s field or set of fields in a record that uniquely defines the record.
Archy [21]
A primary key is the answer. =)
5 0
3 years ago
Create a for-loop which simplifies the following code segment: penUp(); moveTo(100,120); turnTo(180); penDown(); moveForward(25)
kvasek [131]

Answer:

for(var i=0; i<3; i++) {

  penUp();

  moveTo(100,120);

  turnTo(180);

  penDown();

  moveForward(25);

}

Explanation:

The i variable is the loop dummy. The code block will be executed 3 times.

7 0
3 years ago
HELP ME PLEASE <br> Can you help get back my ro blox account: (LOLCrashForce)
abruzzese [7]

Answer: sorry we cannot help

Explanation:

5 0
3 years ago
Read 2 more answers
A monitor is a type of? CPU input memory output
aleksklad [387]

Answer:

Un monitor es un periférico de salida en el que la computadora muestra las acciones y ejecuciones que se realizan él.

Explanation:

:D

5 0
3 years ago
This lesson introduced the notion of "efficiency" in programming, and that it might mean different things at different times. Th
Morgarella [4.7K]

Answer:

<u>In physics</u>, efficiency is a measure of how much energy is conserved in a process.

<u>In programming</u>, efficiency is directly linked with the speed of runtime execution for software and algorithmic efficiency.

In this comparison, both meanings try to measure the quality of the processes and have formulas to detect this efficiency.

Both meanings have different formulas to define the measures, Big O notation for programming and percentage of energy output divided by energy input for physics. Furthermore, in physics is not possible to get 100% efficiency, but it is possible for programming to have O(1) of efficiency.

4 0
3 years ago
Other questions:
  • What is the output after the following code executes?
    14·1 answer
  • How to write "There are four parking spots on campus that may be used only by Nobel Prize winning faculty." this sentence correc
    12·1 answer
  • 1. Write a bash script to create 3 files of different size greater than 1700 kb and less than 1800 kb . The 2. Content of the fi
    9·1 answer
  • HURRRYYYY PLZZ!!
    13·2 answers
  • Though most of the content on this social network is uploaded by amateurs, many companies offer streaming video content related
    10·1 answer
  • Compiler is an example of​
    5·1 answer
  • Mention how to install antivirus software in your computer, either by following the instructions given on installation CDs or we
    6·1 answer
  • Which sequence represents the hierarchy of terms, from smallest to greatest?
    9·1 answer
  • Dominic list his camera for sale on an online auction site Chloe is the highest bitter and purchase as the camera how does the a
    14·1 answer
  • The condition known as __________ occurs when you try to store an integer that is bigger than the maximum allowed by the number
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!