Complete method printpopcorntime(), with int parameter bagounces, and void return type. if bagounces is less than 3, 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:

Respuesta :

W0lf93
public void printpopcorntime(int bagounces) { if (bagounces < 3) { System.out.println("too small"); } else if (bagounces > 10) { System.out.println("too large"); } else { System.out.println( 6*bagounces +"seconds"); } System.out.println("\n"); }

Answer:

     /* Your solution goes here  */

     if(bagOunces < 3)   {

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

     }

     else if ( bagOunces > 10)   {

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

     }

     else   {

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

     }

     System.out.print("");

Explanation:

                                                               /* Explanation  */

     if(bagOunces < 3)   {                        //if bagounces is less than 3  

        System.out.println("Too small");  //print "too small".

     }

     else if ( bagOunces > 10)   {           //if greater than 10

        System.out.println("Too large");  //print "too large".

     }

     else   {                                             //otherwise

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

     }                       //compute and print 6 * bagounces followed by "seconds".

     System.out.print("");                       //end with a newline.

Hope this helps a bit with how I translated the code.