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
Kitty [74]
3 years ago
3

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
code:
import java.util.Scanner;
public class PopcornTimer {
public static void printPopcornTime(int bagOunces) {
/* Your solution goes here */
}
public static void main (String [] args) {
printPopcornTime(7);
}
}

Computers and Technology
2 answers:
shusha [124]3 years ago
5 0

Answer:

import java.util.Scanner;

public class PopcornTimer{

   public static void printPopcornTime(int bagOunces) {

       if(bagOunces < 2)

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

       else if(bagOunces > 10)

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

       else

           System.out.println((6*bagOunces) + " seconds");

   }

public static void main(String[] args) {

 printPopcornTime(7);

}

}

Explanation:

Inside the printPopcornTime method, check the bagOunces using if-else structure.

If bagOunces is smaller than print "Too small", if bagOunces is greater than 10 print "Too large", else multiply bagOunces with 6 and print the result followed by "seconds".

Since given parameter, 7, in the example is neither smaller than 2 nor greater than 10, 7 will be multiplied by 6 which is equal to 42, and "42 seconds" will be printed

s2008m [1.1K]3 years ago
3 0

Answer:

if(bagOunces < 2){

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

  }

  else if(bagOunces > 10){

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

  }

  else{

      System.out.println(6*bagOunces+" seconds");

  }

Explanation:

You might be interested in
When is it most appropriate to quote from an e-mail message in a response?
allochka39001 [22]
I would say *d. when the quote is a part of a series of e-mails written by more than one person.*

eskettit hope this helped.
4 0
3 years ago
Read 2 more answers
This uses the gps methodology to predict the likely location of an offender's base of operation:
iVinArrow [24]
Crime pattern analysis <span>uses the gps methodology to predict the likely location of an offender's base of operation.</span>
6 0
3 years ago
Straight dinosaur walks out of woods : RAWWRRRR
Lena [83]

Answer:

These type of people on brainly are what I live for L M A O

Explanation:

4 0
3 years ago
Read 2 more answers
Which statement describes what the Conditional Formatting option in Excel 2016 allows users to do?
Natasha_Volkova [10]

Answer: all are correct

Explanation:

4 0
3 years ago
Read 2 more answers
Converting Denary to Binary
Dmitrij [34]

Answer:

Converting the numbers provided to decimal:

128: 10000000

64: 01000000

32: 00100000

16: 00010000

1: 00000001

56: 00111000

121: 01111001

45: 00101101

132: 10000010

245: 11111001

4 0
3 years ago
Other questions:
  • Write a Bash script that searches all .c files in the current directory (and its subdirectories, recursively) for occurrences of
    14·1 answer
  • A device that makes it possible for multiple customers to share one address is called a/n _____.
    15·1 answer
  • Why are video games interesting?
    5·1 answer
  • How many words fit on a double-spaced page?
    11·1 answer
  • You are the project manger for Xylophone Phonics. It produces children's software programs that teach basic reading and math ski
    11·1 answer
  • Explain by details operator overloading in C++ with example
    6·1 answer
  • A ________ is a single media file including art, sound, animation, or movies.
    9·1 answer
  • WHO SAYS BUP ALL THE TIME ​
    8·1 answer
  • What is the most likely to be a possible physical attack?
    7·2 answers
  • Es costoso construir un robot
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!