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
Which text features does this section contain? Check all that apply.
NISA [10]

which ones apply manuelh


6 0
3 years ago
________ is digital textual information that can be stored, manipulated, and transmitted by electronic devices.
mars1129 [50]
E-text <span>is digital textual information that can be stored, manipulated, and transmitted by electronic devices. The term "e-text" stands for electronic text and it is used for any digital document written, read, transmitted or manipulated by electronic devices, such as smart phones, PCs, tablets,...The origins of the e-text are in the beginning of the Internet.</span>
7 0
3 years ago
Professor Gig A. Byte needs to store text made up of the characters A with frequency 6, B with frequency 2, C with frequency 3,
Luden [163]

Answer:

This is not true

Explanation:

The optimal Huffman code is used to encrypt and compress text files. It uses fixed-length code or variable-length code for encryption and compression of data.

The professor's character code is similar to Huffman's variable-length coding which uses variable length od binary digits to represent the word strings. The file size of the text file above is;

= 6 x 1 + 2 x 2 + 3 x 2 + 2 x 2 + 8 x 1 = 28 bits

This would be the same for both cases.

The encrypt would be the problem as the encoded and decoding of the characters B and E may cause an error.

8 0
2 years ago
When mysql automatically converts one data type to another, itâs known as a/an ______________________ conversion?
lubasha [3.4K]
<span>MySQL is an open-source relational database management system (RDBMS)</span>
When MySQL automatically converts one data type to another, is known as an implicit conversion. Implicit conversion refers to the mixing and matching data types within the same operation. Example for implicit conversion is when MySQL automatically converts numbers to strings and vice versa. 
5 0
3 years ago
// This pseudocode segment is intended to compute and display
Finger [1]

The pseudocode to calculate the average of the test scores until the user enters a negative input serves as a prototype of the actual program

<h3>The errors in the pseudocode</h3>

The errors in the pseudocode include:

  • Inclusion of unusable segments
  • Incorrect variables
  • Incorrect loops

<h3>The correct pseudocode</h3>

The correct pseudocode where all errors are corrected and the unusable segments are removed is as follows:

start

Declarations

     num test1

     num test2

     num test3

     num average

output "Enter score for test 1 or a negative number to quit"

input test1

while test1 >= 0

     output "Enter score for test 2"

     input test2

     output "Enter score for test 3"

     input test3

     average = (test1 + test2 + test3) / 3

     output "Average is ", average

     output "Enter score for test 1 or a negative number to quit"

     input test1

endwhile

output "End of program"

stop

Read more about pseudocodes at:

brainly.com/question/11623795

3 0
2 years ago
Other questions:
  • What Event is called when an Object collides with an non-trigger collider?
    13·1 answer
  • Which of the following describes a hash algorithms ability to avoid the same output from two guessed inputs?A. Collision avoidan
    12·1 answer
  • What is the energy conversion of solar water heaters?
    12·1 answer
  • How can you tell if a website is secure
    13·1 answer
  • In this mode, your presentation will fill up the entire screen. Auto Default Standard Window
    6·2 answers
  • What is the output after running the following code snippet? int number = 600; if (number &lt; 200) { System.out.println("Low sp
    15·1 answer
  • _______________ ________________ have human editors that evaluate, select, and organize websites into a hierarchy of categories.
    11·1 answer
  • A school has an intranet for the staff and students to use. Some of the files stored on the intranet are confidential. Give two
    15·1 answer
  • Explain the basic operations of a computer system​
    6·1 answer
  • Fill in the blank
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!