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
What does HTML stand for?
Wittaler [7]

Hypertext Markup Language

5 0
3 years ago
Read 2 more answers
Who is demonstrating entrepreneurship?
Taya2010 [7]

Answer: D: A recent graduate makes money helping teachers sell their lesson plans online.

Explanation: I am in accounting and have taken it for 3 years.

4 0
3 years ago
Does technology get in the way of learning ?<br> Help Meh ! ♥ Some ideas :D
Nady [450]
Yes, and no, social network can distract a student like YouTube or face book, while it can be used as a tool for studying and to put your google documents in the cloud. plus if a teacher posts homework on his/her website, and you happen to forget the paper bringing it home, you can just simply print it instead of having to explain to the teacher
6 0
3 years ago
Read 2 more answers
Driver's ed I need help
UkoKoshka [18]
The second one I believe 
8 0
4 years ago
Read 2 more answers
Moving through a neighborhood trying to locate open wireless access points is called ________.
disa [49]
<span>Moving through a neighborhood trying to locate open wireless access points is called wardriving. 
</span> The action wardriving is performed by a person in a moving vehicle (car, bike..) who is using a laptop or smartphone and wants to catch a Wireless LAN (WiFi) network. For this purpose there is software <span>freely available on the Internet.</span>
7 0
3 years ago
Other questions:
  • O que é sistema distribuido?
    8·1 answer
  • What does this mean in python?
    5·1 answer
  • C++ Proagram
    7·1 answer
  • In order to place a gradient within a stroked path for type, one must convert the type using the __________
    15·1 answer
  • What technological development happened most recently?
    12·2 answers
  • Which of the following describe audio-editing software? Choose all that apply.
    5·2 answers
  • Jolly 4 pls link in description
    7·1 answer
  • How to remove a course from your canvas calander feed.
    11·1 answer
  • Data elements in a relational database are organized into ____
    15·1 answer
  • Write and test a program that computes the area of a circle. This program should request a number representing a radius as input
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!