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
Is the cell phone changing our views about polite and impolite behavior? For example,
DochEvi [55]

*This question seems like an opinion based question, but here is my opinion on the matter:

Yes the cell phone is changing our views of what is polite and impolite. It is indeed impolite to talk on your phone while you are ordering a drink at Starbucks, because then you aren't focusing on ordering instead you are focused on your phone call which can interfere with your ordering.

Hope this helps!

8 0
3 years ago
Read 2 more answers
Virtually all webcams plug into a(n) ________ port.
-Dominant- [34]
The answer is an usb port
5 0
3 years ago
Read 2 more answers
Give an explanation of one network connection (it will every helpful​
charle [14.2K]

Answer:

WiFi, Ethernet, Broadband, Dial-up. Any of those.

Explanation:

Network connections are all different. Those listed are some of the many examples of network connections.

7 0
2 years ago
The packets used to transmit voice on the Internet are similar to the packets that are used to send email. What are some of the
Alona [7]

Answer:

Quality of service (QOS).

Explanation:

In recent computer networking, the convergence of voice, video and text data packet has been made possible. There is no need for a dedicated network for a particular type of packet.

QOS or quality of set is a service rendered to voice or audio packets in VoIP phones to enhance communication.

The email is a digital mailing system that can be used to send all three packets. It enjoys the QOS as voice packets. It is given high preference for transmission and uses the TCP protocol to transmit data reliably.

8 0
3 years ago
PLEASE HELP!!! What are the benefits of online notebooks? Check all that apply.
Kipish [7]

They allow users to store files.

They allow users to share files.

They help users organize assignments.

They allow users to clip information from web pages.

4 0
2 years ago
Read 2 more answers
Other questions:
  • Forms often allow a user to enter an integer. Write a program that takes in a string representing an integer as input, and outpu
    9·1 answer
  • With a _____ network connection, the computers and other devices on the network are physically connected via cabling to the netw
    13·1 answer
  • Suppose company A wants to develop a program that duplicates the functionality of a programm by company B. Describe how company
    8·1 answer
  • Laura wants to know more about the organization to which she has applied. What can she do to know more about the organization’s
    12·1 answer
  • Gina works in an SDLC team. When Gina makes changes to a file, no one else is allowed to acess it. Which type of version control
    10·1 answer
  • "what type of index has an index key value that points to a data row, which contains the key value? "
    9·1 answer
  • __________ can be used to replace internal network addresses with one or more different addresses so the traffic that actually t
    9·1 answer
  • When a collection of honeypots connects several honeypot systems on a subnet, it may be called a(n) honeynet
    9·1 answer
  • What's the maximum number of ad extensions that can show for a particular query or device at any given time?
    13·1 answer
  • Why is a salt added to a password that is being stored in a database?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!