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
Anettt [7]
4 years ago
4

Complete method printPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 2, print "Too

small". If greater than 10, print "Too large". Otherwise, compute and print 6 * bagOunces followed by " seconds". End with a newline. Example output for ounces = 7:
42 seconds
import java.util.Scanner;
public class PopcornTimer {
public static void printPopcornTime(int bagOunces) {
/* Your solution goes here */
}
public static void main (String [] args) {
Scanner scnr = new Scanner(System.in);
int userOunces;
userOunces = scnr.nextInt();
printPopcornTime(userOunces);
}
}
Computers and Technology
1 answer:
Ulleksa [173]4 years ago
5 0

Answer:

Replace

<em>/* Your solution goes here */ </em>

with

<em>if (bagOunces < 2) { </em>

<em>    System.out.print("Too Small"); </em>

<em>} </em>

<em>else if(bagOunces > 10) { </em>

<em>    System.out.print("Too Large"); </em>

<em>} </em>

<em>else { </em>

<em>    System.out.print((bagOunces * 6)+" seconds"); </em>

<em>}</em>

<em />

Explanation:

This line checks if bagOunces is less than 2;

<em>if (bagOunces < 2) { </em>

If yes, the string "Too Small" is printed

<em>    System.out.print("Too Small"); </em>

<em>} </em>

This line checks if bagOunces is greater than 10

<em>else if(bagOunces > 10) { </em>

If yes, the string "Too Large" is printed

<em>    System.out.print("Too Large"); </em>

<em>} </em>

The following condition is executed if the above conditions are false

<em>else { </em>

This multiplies bagOunces by 6 and adds seconds

<em>    System.out.print((bagOunces * 6)+" seconds"); </em>

<em>}</em>

You might be interested in
For an activity with more than one immediate predecessor activity, which of the following is used to compute its earliest finish
laila [671]

Answer:

The correct option is A

Explanation:

In project management, earliest finish time for activity A refers to the earliest start time for succeeding activities such as B and C to start.

Assume that activities A and B comes before C, the earliest finish time for C can be arrived at by computing the earliest start-finish (critical path) of the activity with the largest EF.

That is, if two activities (A and B) come before activity C, one can estimate how long it's going to take to complete activity C if ones knows how long activity B will take (being the activity with the largest earliest finish time).

Cheers!

7 0
3 years ago
gina wants to add another resistor to this circuit. She wants to ensure that after the new resistor is added, it will all work i
Bas_tet [7]

D) one lead in front of the current resistor, one behind it:

Explanation:

5 0
4 years ago
Read 2 more answers
Explain different types of secondary memory of computer system<br>​
Westkost [7]

<em>Answer:</em>

<em>There are three main types of secondary storage in a computer system: solid state storage devices, such as USB memory sticks. optical storage devices, such as CD, DVD and Blu-ray discs. magnetic storage devices, such as hard disk drives.</em>

<em>Explanation:</em>

6 0
2 years ago
You have repaired a broken LCD panel in a laptop computer. However, when you disassembled the laptop, you bent the hinge on the
Romashka-Z-Leto [24]

Answer:

Listen carefully to the customer and avoid getting defensive or even offensive.

Explanation:

The customer have every right to be angry since he might be ignorant of the work done and only act base on what he sees. In this scenario you need to listen carefully to his complain avoid been defensive and also avoid getting him/her more angry by been offensive. after he has laid out his complain you can then go ahead to explain why it is necessary to bend the hinge on the lid.

5 0
3 years ago
How many terms are in the expression 3x to the second + 4 y - 1
saul85 [17]

"Terms" are things you add up or subtract.

So ... + ... - ... has three terms.

3x² + 4y - 1 has three terms.


7 0
4 years ago
Other questions:
  • In which career field, would the Computing Technology Industry Association's CompTIA A+ certification be useful?
    13·1 answer
  • What formula would be used to add two cells together after the equal sign?
    9·2 answers
  • B. Write a function that takes one double parameter, and returns a char. The parameter represents a grade, and the char represen
    7·1 answer
  • What is an icon or animation used to represent a participant in an internet chat referred to as
    15·2 answers
  • What types of disasters might be most likely to affect your community? Type your answers in the space provided. When you are fin
    9·2 answers
  • Which you could use an Excel chart to present your data?
    15·1 answer
  • ASAP: Type the correct answer in the box. Spell all words correctly.
    11·1 answer
  • Given the declaration Circle x = new Circle(), which of the following statements is most accurate?
    11·1 answer
  • What critical-thinking tool is being used when asking the question, Is this information specific enough?
    9·1 answer
  • Algorithm to print the first 10 odd numbers​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!