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
2.
Masja [62]

Answer:

is this a question or not?

6 0
3 years ago
Jason Chang is creating photos of his restaurant for a new website. Some of the photos of the staff have red eye, others are bad
Nadusha1986 [10]

It is okay to modify photos digitally to improve their appearance as long as it doesn't show what they aren't producing.

<h3>What is Advertisement?</h3>

This is the act of persuading people to buy goods and services and is usually done with the aid of the media.

Pictures are usually taken which have to be in the best shape and quality in order to entice people to buy the goods thereby bringing about higher sales and profit for the company.

Read more about Advertisement here brainly.com/question/1020696

7 0
2 years ago
Write a python code for a calculator
Bingel [31]

Answer:

In this example you will learn to create a simple calculator that can add, subtract, multiply or divide depending upon the input from the user.

Explanation:

8 0
3 years ago
Read 2 more answers
Write a python application that allows a user to enter any number of student test scores until the user enters 999. If the score
Kryger [21]

Answer:

This program is as follows

<em>total = 0; count = 0</em>

<em>testscore = int(input("Score: "))</em>

<em>while testscore != 999:</em>

<em>    if testscore < 0 or testscore > 100:</em>

<em>        print("Out of range")</em>

<em>    else:</em>

<em>        total+=testscore</em>

<em>        count+=1</em>

<em>    testscore= int(input("Score: "))</em>

<em>print(count,"scores entered")</em>

<em>print("Arithmetic Average:",total/count)</em>

Explanation:

This initializes total and count to 0

total = 0; count = 0

This gets input for score

testscore = int(input("Score: "))

The following iteration stop when 999 is entered

while testscore != 999:

This prints out of range for scores outside 0 - 100

   if testscore < 0 or testscore > 100:

<em>        print("Out of range")</em>

Otherwise

   else:

The total score is calculated

       total+=testscore

The number of score is calculated

       count+=1

Get another input

   testscore = int(input("Score: "))

The number of score is printed

print(count,"scores entered")

The average of score is printed

print("Arithmetic Average:",total/count)

7 0
3 years ago
5.
larisa86 [58]

Answer:

Explanation:

5 is correct answer

3 0
2 years ago
Other questions:
  • Describe the function of the user account section of the control panel
    13·1 answer
  • Using a pin or password in addition to tpm is an example of what type of authentication?
    13·1 answer
  • Life Decisions Cyber Cafe is a cafe with free Internet service and computers that are linked to various online career opportunit
    15·1 answer
  • User can use ______ commands to search for and correct words in a document
    13·1 answer
  • At each layer of the OSI model, data is appended to the original message and then sent on to the next lower layer. What is this
    10·1 answer
  • Which model represents any process in general?
    6·1 answer
  • What does command do
    5·1 answer
  • Write an algorithm to find the average of three numbers: 10, 20, 30
    7·1 answer
  • Valerie regularly generates sales reports from her organization's data warehouse. She uses these reports to create presentations
    5·1 answer
  • A network of computers that provides access to information on the web.
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!