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 is the tool that helps you get an interview?
Scorpion4ik [409]

Answer:

resume is a tool that helps you get an interview

5 0
3 years ago
Read 2 more answers
After you use the create sequence statement to create a sequence, you can use the _______________________ pseudo column to get t
user100 [1]

After you use the create sequence statement to create a sequence, you can use the NEXTVAL  pseudo column to get the next value in the sequence.

<h3 /><h3>How do you create a sequence?</h3>
  • You must have the Create any sequence system privilege to create a sequence in another user's schema.
  • Specify the schema that will hold the sequence.
  • If you leave out schema, Oracle Database will create the sequence in your own schema. Name the sequence that will be created.
  • Pseudo-columns allow selection, but you cannot edit, update, or remove their values.
  • A pseudo-column is analogous to a function that does not accept any inputs. This section goes over the two pseudo-columns, CURRVAL and NEXTVAL.
  • A pseudo column is a "column" that displays a value when a value is selected but is not one of the table's true columns.
  • Two examples are SysDate and RowID. It is frequently used in tandem with the DUAL table.
  • After you utilize the make sequence statement to make a sequence, you can utilize the NEXTVAL pseudo column to obtain the next value in the sequence.

To learn more about NEXTVAL, refer to:

brainly.com/question/13043887

#SPJ4

3 0
1 year ago
What questions do they ask in Discussion based assessment drivers Ed?
Rashid [163]

There can be various questions that can be asked some of them are:

Why a person should use headlights while driving?

It is very important to turn on the headlights while driving because it allows a better vision and lowers the risks of accident. Good visibility is a major factor in driving

Why should someone not take medications, whilst driving?

Well, when people tend to take medicines they have a tendency to feel sleepy or drowsy, because most of the medicines are relaxants and it is highly avoided to take medicines before driving so the driver is fully attentive to lower the risks of accidents.

6 0
3 years ago
Which of these describes a slide transition?
Tresset [83]
The right answer is B. :3
3 0
3 years ago
Read 2 more answers
____ characterized the period now known a Web 1. 0. Augmented reality
Helen [10]

Answer:

User- generated content is the finally answer

7 0
2 years ago
Other questions:
  • When typing the word "weather" when you meant to type the word "whether" when will writer or word flag this as a misspelling or
    8·1 answer
  • What is an effective way to display calculations in a Word document
    7·2 answers
  • Most sim cards allow ___________ access attempts before locking you out.
    10·1 answer
  • Write a method named circleArea that accepts the radius of a circle as a parameter (as a real number) and returns the area of a
    12·1 answer
  • Please help! i need to answer this soon!
    13·1 answer
  • Each of k jars contains m white and n black balls. A ball is randomly chosen from jar 1 and transferred to jar 2, then a ball is
    10·1 answer
  • The visitor's age is stored in the variable age, the day of the week is stored in a variable day, and the price in dollars is st
    8·1 answer
  • How can i get games on my chromebook after my school has blocked almost everything... even zoom!
    14·1 answer
  • While shopping online, Tucker visits a website that looks outdated and has limited reviews. Which of the following strategies sh
    11·1 answer
  • A(n) ________ is a way of retrieving information from one or more tables that defines a particular subset of data.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!