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
At a local marketing firm, Steve is the lead Web developer and is responsible for working with customers on their Web designs, d
attashe74 [19]

Answer:

All of the above.

Explanation:

Understanding that he must create a unique domain name for each client

Being able to work with HTML

Understanding of the World Wide Web and how hyperlinks work

All of these would be a critical skill Steve must have to be able to perform his job.

6 0
3 years ago
Purple gang or green gang?
zhuklara [117]

Answer:

Purple?

Explanation:

8 0
3 years ago
Read 2 more answers
Online Book Merchants offers premium customers 1 free book with every purchase of 5 or more books and offers 2 free books with e
docker41 [41]

Answer:

8/9

Explanation:

i remember this question on my daughters book

8 0
3 years ago
Three broad categories of cryptographic algorithms are commonly used to create PRNGs: symmetric block ciphers, asymmetric cipher
RideAnS [48]

Answer:

True.

Explanation:

In generating PRNGs, several specific types of crypto algorithms will be widely will use: linear cipher block, nonlinear ciphers, as well as hash methods and authorization instructions in messages. So, that's why the following scenario is true about the cryptographic algorithms because this is a collection of several excellently defined however complicated mathematics techniques for encoding or decoding information.

7 0
3 years ago
Why do we have to watch a video to get answers?
IRINA_888 [86]

Answer:

The videos contain the answers.

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • Jason is creating a webpage on the basic parts of a camera. He has to use a mix of both images and content for the web page to h
    11·1 answer
  • From the Start screen, you can A. access recently opened Excel workbooks. B. create a document from a template. C. create new bl
    12·2 answers
  • what is the restaurant with the black pom tree and yellow backround three letter name from hi guess the restaurant
    14·2 answers
  • Why was the movable type of the printing press such a breakthrough for publishing?
    15·2 answers
  • Which of the following best describes a server?
    7·2 answers
  • EDVAC stands for? on which theory it is made on?
    15·1 answer
  • All states that have altered judicial selection techniques in recent years have adopted some form of:
    5·1 answer
  • The road is closed a head
    9·1 answer
  • Python program oranges and apples 3.4.6 copy and paste would be nice
    7·1 answer
  • What can you use to make sure that you have no errors in Word Online?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!