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 package that includes hardware, software, and support from a single vendor is called a(n ____ package.
dmitriy555 [2]
The appropriate response is turnkey. It is a kind of venture that is built so it can be sold to any purchaser as a finished item. This is stood out from work to request, where the constructor fabricates a thing to the purchaser's correct determinations, or when an inadequate item is sold with the supposition that the purchaser would finish it.
6 0
3 years ago
One of the first and main steps in protecting your email is to have a __________ filtering system.
Alexxx [7]

<em>Answer:</em>

<em>One of the first and main steps in protecting your email is to have a </em><em><u>URL</u></em><em> filtering system.</em>

3 0
3 years ago
Counselors do NOT provide which service during treatment?
Ivan

Answer:

Civil settlement

Explanation:

5 0
3 years ago
Read 2 more answers
Is(are) input value(s) to use with a program to test the accuracy of the output.
Law Incorporation [45]

Answer:

test cases

Explanation:

5 0
3 years ago
Read 2 more answers
HELP FAST PLEASE
never [62]

Answer:

I am not sure can you explain a little more

7 0
2 years ago
Read 2 more answers
Other questions:
  • A powerpoint ________ is a set of unified design elements.
    5·1 answer
  • which telecommunications service allows internet and telephone service to work over the same phone line
    13·1 answer
  • In order to organize your work effectively on the computer, where is the best place to save it?
    14·2 answers
  • What is unique about the TODAY and NOW functions?
    15·2 answers
  • Match the organelles to their functions.
    6·1 answer
  • Partes de la ventana principal de Microsoft excel 2013 con sus respectivas funciones
    14·1 answer
  • Write the two features of a mouse.​
    9·1 answer
  • A hard drive cannot be partitioned until the device <br> is set.
    10·1 answer
  • Create a Python program that computes the cost of carpeting a room. Your program should prompt the user for the width and length
    10·1 answer
  • If you had tickets for the concert and saw these alerts, what should you do?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!