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]
2 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]2 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
Define the role of websites in internet.also write the importance of internet in our daily life.
BabaBlast [244]

Answer:

       

      <u> </u><u>Role of websites in internet</u>

  • Websites give the online way to the business,it helps the business to grow and reach the higher audience. There was a time,at which there is no apps only HTML/CSS websites are there so it is a building step for reaching the audience.
  • Time is a one of the major factors for growth in online sector, and websites provide a interface to use their resources and services at less time ,you don't have to go somewhere now you can order from anywhere and anytime. 24/7 hour services gives a boost to the websites.
  • Some of the Applications are Very big but you can access them in very less amount of internet. Apps never replace websites.
  • Most of the billionaires are the ones who builds there website like amazon, twitter etc. It is very important to have a website for the business        

        <u>Importance of internet in our daily life</u>

  • Internet provides various resources and services which we need at every time like booking a cab,hotel,flight,trains and tutoring services . It consist a vast variety of information which is required at every moment .
  • We really don't need any physical presence of someone to learn something , to understand or for asking it is enough up on internet. Things are changing as technology grows.
  • For leisure time, it provide social sites to enjoy and there are much good options to ask the question of any subject.      
  • It also give option to promote business , it helps to reach to higher audience, many companies give services to us as there business. Digital marketing is also up there to promote on social sites.
3 0
3 years ago
Which document would most likely be written in an informal style?
Masteriza [31]

Answer:

An advertisement for sportswear

Explanation:

An advertisement for sportswear would most likely be written in an informal style.

6 0
3 years ago
PLEASE ANSWER ASAP!! Where is the findmore answers page I NEEDDD the bsdge
asambeis [7]

Answer:

hi earlier u told me to answer ur question but i couldn't respond in the comments cos it said something went wrong

Explanation:

do i answer this question seriously or is this answer good?? srry im kinda dûmb T-T

3 0
2 years ago
_______and ________ enables computers to communicate and it can pass information between two networks.
lozanna [386]

Answer:

Internet Protocol and Transmission Control Protocol        

Explanation:

Internet protocol, which is also known as IP and Transmission Control Protocol, which is also known as TCP are the two important protocols that enables the computers to communicate various information and data and allow it to pass between two networks. It allows computers to connect to each other.  They are developed by Bob Kahn and Vint Cerf.

4 0
2 years ago
The georgia _______________ law encourages people to help others in emergency situations and protect people who offered reasonab
Naddik [55]

The Georgia Good Samaritan law encourages people to help others in emergency situations and protect people who offered reasonable help.

3 0
3 years ago
Other questions:
  • Choose the correct sequence for classifier building from the following.
    7·1 answer
  • What is an independent data mart?
    8·1 answer
  • To name a computed field, follow the computation with the word ____ and then the name you wish to assign to the field
    8·1 answer
  • Oracion con punto focal​
    6·1 answer
  • Which of the following is the answer?
    5·1 answer
  • Write a function namedmake_complex that stores its twoarguments (both of type double) in acomplex structure, then returns thestr
    12·1 answer
  • You want to calculate a bonus if the sold price was at least equal to the listing price, and if the house sold within 30 days af
    6·1 answer
  • User defined blocks of code can be created in
    13·1 answer
  • Can you help me with this question please ​
    13·1 answer
  • Which of the following shows data conversion taking place?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!