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
True or false for a given set of input values, a nand
Katen [24]
Nand stands for "not and". The truth table for a nand is:

a b | a nand b
0 0 |      1
0 1 |      1
1 0 |      1
1 1 |      0

Hopefully this helps you answer your question.
6 0
3 years ago
Which type of formatting would you apply to spreadsheet data so that each cell is outlined?
rjkz [21]

Answer:

D. Border

Explanation:

Edge 2020

5 0
2 years ago
Does kohl's sell homecoming dresses?? And if do you know what the price rage would be !!
SpyIntel [72]

Answer:

Yes, the prices are anywhere from $30-$100 dollars+tax

https://www.kohls.com/catalog/juniors-homecoming-dresses-clothing.jsp?CN=Gender:Juniors+Occasion:Homecoming+Category:Dresses+Department:Clothing

6 0
2 years ago
What is the relationship between CAD and CIM ?
Marat540 [252]
<span> CAM( computerised Aided Manufacture) is when you have workers being helped by computerised tools, CIM (computerised intergated manufacture) is when the whole process is computerised, in manufacture this usually uses robotic arms. These can manufacture 24/7 in needed, they can work very accurately ( they are faster and stronger than a human arm) </span>
5 0
3 years ago
Read 2 more answers
Bella wants to be a chemical engineer and work for an oil company. Which best describes her career goals?
Gemiola [76]
<span>She wants to work in natural resources.</span>
6 0
3 years ago
Read 2 more answers
Other questions:
  • Choosing the “Quick Print” button will ____________.
    14·1 answer
  • Tell me about how to build robots
    11·1 answer
  • Which organization safeguards americans from health, safety, and security hazards and threats?
    14·2 answers
  • When an interrogator speaks highly about how a crime was committed, hoping to get the suspect to brag about his or her involveme
    7·2 answers
  • (Convert milliseconds to hours, minutes, and seconds) Write a function that converts milliseconds to hours, minutes, and seconds
    12·1 answer
  • Yolanda first breaks down the whole game she needs to program into modules. She then breaks these modules into smaller modules u
    11·1 answer
  • Whats a field in databases?
    5·1 answer
  • Design a class named Person and its two subclasses named Student and Employee. Make Faculty and Staff subclasses of Employee. A
    13·1 answer
  • On his website, Mario has a video that visitors must click to play. He wants the video to play automatically when the page loads
    9·1 answer
  • Which graphic file format would you choose if you needed to make an animated graphic for a website?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!