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 did Francis Ford Coppola and George Lucas create?
garik1379 [7]
. 3d animation markers
7 0
3 years ago
After execution of the following code, what will be the value of input_value if the value 0 is entered at the keyboard at run ti
katen-ka-za [31]
Cin >> input_value;
if (input_value > 5)
input_value = input_value + 5;
else if (input_value > 2)
input_value = input_value + 10;
else
input_value = input_value + 15;

The right answer is : 15
7 0
4 years ago
A competitor goes to your public website and discovers that they can get into a directory that you did not know could be reached
Ivan

Answer:

Yes, directory traversal attack.

Explanation:

A website is a collection big web pages hosted on a web server. It contains contents like links and sometimes directory root paths. This a vulnerability attacks an exploit to access the information in a database.

There are two access to a database. One is the authentication process issued for authorised user access and the other is the root access only accessible to the network administrator. It contains paths to directories in the servers.

A directory traversal attack or path attack is done through a web browser by an attacker, who seeks for a weak path link on the public's website and accesses the information in the server.

5 0
3 years ago
A store manager is looking at inventory and decides it is time order swim suits because the spring time is approaching. This is
Fudgin [204]

Swimsuit Trends Taking Over Instagram ... taking a careful look at our current bathing suit inventory. ... or you're just looking for some quality lounge chair time, ...

3 0
4 years ago
If a priority queue is being implemented using an unordered list, what is the Big-O complexity of the Enqueue operation?
lidiya [134]

Answer:

<u>the answer is O(1)</u>

Explanation:

A priority queue is a type of queue whereby each of the elements are linked with a priority and the elements are served according to their priority.

The word enqueue means to add elements to the back of the queue

<em><u>For this question, while using an unordered list, O(1) is the big-O complexity of the enqueue operation. O(1) is a natural Choice for queues.</u></em>

6 0
3 years ago
Other questions:
  • The binary search algorithm ________. will have a maximum number of comparisons equal to the number of elements in the array wil
    7·1 answer
  • A user receives a phone call from a person claiming to be from technical support. This person knows the users name and that the
    12·1 answer
  • A personal computer system is composed of the processing unit, graphics board, and keyboard with reliabilities of 0.976, 0.785,
    8·1 answer
  • Which description of the plain text file format is most accurate?
    10·1 answer
  • 1. What are the benefits and drawbacks of keeping separate journals for individual accounts?​
    8·1 answer
  • Why is ssh preferred over telnet for remote connections?
    10·1 answer
  • When shopping on the web, it is better to pay for your purchase with a debit card rather than a credit card.
    10·2 answers
  • Serena, an analyst at an environmental agency, wants to prepare a report using data from the Car Emissions database.
    11·2 answers
  • What is the encoding technique called that is used to store negative numbers in the computer's memory
    10·1 answer
  • What are three ways to protect yourself from identity theft when using your smartphone or computer?.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!