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
pickupchik [31]
3 years ago
14

Use a switch statement to display "one" if the user has entered 1, "two" if the user has entered 2, and "three" if the user has

entered 3. If a number other than 1, 2, or 3 is entered, the program should display an error message: "Enter one of the numbers - 1, 2, or 3."
Computers and Technology
1 answer:
astra-53 [7]3 years ago
4 0

Answer:

import java.util.Scanner;

public class num5 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter one the numbers - 1, 2, or 3.");

       int num = in.nextInt();

       switch (num){

           case 1:

               System.out.println("one");

               break;

           case 2:

               System.out.println("two");

               break;

           case 3:

               System.out.println("three");

               break;

           default:

               System.out.println("Error");

       }

   }

}

Explanation:

  • Using Java Programming Language
  • User Scanner Class to prompt, receive and store user's input
  • Use a switch statement with three cases as required by the question to output one, two or three
  • Use the default statement to handle any other case
You might be interested in
Anyone got E-aqa login?​
pashok25 [27]

Answer:no

Explanation:

3 0
3 years ago
Machine code and Object code is the same right?​
guapka [62]

Answer:

"True" Machine code and Object code is the same.

Explanation:

All code at the same level is considered the same code, so we can say that the machine code, byte code, and the object code with it is of the same type, all of which are considered as the lowest level associated with the common program, these are common. Also known as source code because it is used in translating different languages.

6 0
3 years ago
The measure of error in keyboardist is called?​
Dimas [21]
Jjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
8 0
3 years ago
 A network engineer is examining a configuration implemented by a new intern who attached an IP phone to a switch port and confi
lakkis [162]
Where is the answer?????????

7 0
3 years ago
This is a type race kindly join.
xeze [42]

Answer:

NO THANKS FOR THAT I WILL NOT JOIN

8 0
3 years ago
Other questions:
  • The layout button is located in the ____ group on the home tab?
    14·1 answer
  • Select the correct answer from each drop-down menu.
    8·1 answer
  • In this mode, your presentation will fill up the entire screen. Auto Default Standard Window
    6·2 answers
  • Bargain Bob's auto dealership sells vehicles. He sells Chrysler, Jeep, and Dodge brand vehicles. He tracks customer and manufact
    12·1 answer
  • What does lurch mean
    14·2 answers
  • Who is a data base administrator
    12·1 answer
  • When Judy logged on the network, she faced the message requesting that she changes her password. So, she changed her password. B
    10·1 answer
  • What caused accident? into passive voice​
    13·1 answer
  • What makes a source credible?
    9·2 answers
  • ANSWER QUICKLY!!! <br><br> What is an advantage of digital portfolios?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!