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
Anastaziya [24]
3 years ago
8

Assume that minutes is an int variable whose value is 0 or positive. Write an expression whose value is "undercooked" or "soft-b

oiled" or "medium-boiled" or "hard-boiled" or "overcooked" based on the value of minutes. In particular: if the value of minutes is less than 2 the expression's value is "undercooked"; 2-4 would be a "soft-boiled", 5-7 would be "medium-boiled", 8-11 would be "hard-boiled" and 12 or more would be a "overcooked".
Computers and Technology
1 answer:
e-lub [12.9K]3 years ago
4 0

Answer:

import java.util.Scanner;

public class Solution {

   public static void main(String args[]) {

     Scanner scan = new Scanner(System.in);

     System.out.println("Enter your minute:");

     int minute = scan.nextInt();

     

     switch(minute){

         case 0:

         case 1:

             System.out.println("undercooked");

             break;

         case 2:

         case 3:

         case 4:

             System.out.println("soft-boiled");

             break;

         case 5:

         case 6:

         case 7:

             System.out.println("medium-boiled");

             break;

         case 8:

         case 9:

         case 10:

         case 11:

             System.out.println("hard-boiled");

             break;

         case 12:

             System.out.println("overcooked");

             break;

         default:

             if(minute > 12){

               System.out.println("overcooked");

             } else if (minute < 0){

                 System.out.println("Enter a valid minute.");

             }            

     }

   }

}

Explanation:

The first line is the import statement, which import the Scanner class for receiving user input. The next line is the class declaration which is named Solution.

The Scanner object is declared and assigned as scan. Then a prompt is displayed to the user asking the user to enter the minute. The user input is stored as minute.

Switch statement is use to categorize the user input. If the user enter 0-1, an output of undercooked is displayed. If the user enter 2-4, an output of soft-boiled is displayed. If the user enter 5-7, an output of medium-boiled is displayed. If the user enter 12 or any number above 12, an output of overcooked is displayed. Again, the user enter a number less than zero, an error message is displayed telling the user to enter a valid number.

You might be interested in
The _______ valve protects the air pump from reverse-exhaust pressure.
alexandr402 [8]
D. The answer for this is the gulp
7 0
2 years ago
Why is it important to ensure that dns servers have been secured before implementing an e-mail system? awr138?
Alex
So you don’t get black listed as spam for outgoing mail, and I hope this one is obvious - to make sure the server isn’t vulnerable to hackers and malware.
7 0
3 years ago
Which education and qualifications are most helpful for Law Enforcement Services careers? Check all that apply.
bixtya [17]

Explanation:

For IAS..we need a high amptual amount of knowledge..

For IPS..we need master degree and physical fitness too..

For An Advocate..we need Master degree and social Skills..

so..the education and qualifications depends on the various jobs..

HOPE THE ANSWER IS USEFUL

3 0
2 years ago
What is the most important for you to choose before you build a network?
olga nikolaevna [1]
Network media is most important
4 0
3 years ago
What are the missing whole numbers on this number line? Enter your answers in the boxes. plz show work I'm I need answer 3rd gra
adell [148]
1 3 and 4... you are just counting up from 0
5 0
2 years ago
Other questions:
  • *****NEED HELP ASAP!!!! COMPUTER HELP!!!! PLEASE!**
    13·1 answer
  • What are the 7 basic components found in a computer tower
    5·2 answers
  • The Transmission Control Protocol (TCP) splits each message into multiple packets. It's possible for packets from the same messa
    10·1 answer
  • Using underlining and italics at the same time is which of these? A. allowed but might be overkill B. always a good idea C. not
    15·2 answers
  • Which is said to be ‘computer on a chip’
    8·1 answer
  • For this exercise, you'll use the Rectangle class below (you can assume that the length and width are measured in feet).
    12·1 answer
  • A ______________ is a way of taking a screenshot or a picture of your computer screen. ​
    14·1 answer
  • Write a class called Person that has two data members - the person's name and age. It should have an init method that takes two
    12·1 answer
  • Adam has designed and tested an Android app for a startup. The client expects to get quick responses to the app. After consultin
    7·1 answer
  • Sustainable development is a goal towards which all human societies need to be moving. elaborate the statement in about 120 word
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!