Question: What would the coding be for this problem? Write a program that helps a novice microwave chef decide how long to microwave a refrigerated bread


Write a program that helps a novice microwave chef decide how long to microwave a refrigerated bread roll. Use the Math class to generate a random integer between 0 and 60 to represent the number of seconds the roll will be microwaved. Print out the number of seconds generated. If the number is less than or equal to 20, print Perfect cooking time! If the number is greater than 20, print Your roll will catch fire! If you've forgotten how to use random numbers, refer back to the slides: Random Number Slides Here are a few output examples Example 1 Microwaving for 21 seconds TOP SOLUTC Teror SCCUNOS VITU VICTOIVUVeu. Print out the number of seconds generated. If the number is less than or equal to 20, print Perfect cooking time! If the number is greater than 20, print Your roll will catch fire! If you've forgotten how to use random numbers, refer back to the slides: Random Number Slides Here are a few output examples Example 1: Microwaving for 21 seconds Your roll will catch fire! Example 2 Microwaving for 9 seconds Perfect cooking time! 1 import java.util.*; 2 import java.lang.*; 3 import java.io.*; 4 public class MicrowaveCooking 6-{ 7 public static void main(String[] args) throws java.lang. Exception 8- { 9 1/ Generate a random number of seconds 10 double randomDouble = Math.random(); 11 randomDouble*=60; 12 int ans - (int)randomDouble; 13 System.out.println("Microwaving for "+ans+" seconds"); if(ans
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
