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
olga_2 [115]
3 years ago
15

A video game controller contains the buttons: A, B, X, Y. When the player presses A their character Jumps. When the player press

es BY their character Crouches. When the player presses X their character Punches. When the player presses Y their character Flies. When the player presses anything else Pause menu shows up Assume your program contains a variable named button that holds a character which indicates the button the player has pressed. Write the switch statement that displays a message explained the user the action that was taken.
Computers and Technology
1 answer:
Lina20 [59]3 years ago
3 0

Answer:

Explanation:

The following switch statement takes in the variable button as a parameter and outputs a statement saying what the character did due to the button being pushed.

switch (Character.toLowerCase(button.charAt(0))) {

           case 'a': System.out.println("Your character has Jumped"); break;

           case 'b': System.out.println("Your character has Crouched"); break;

           case 'x': System.out.println("Your character has Punched"); break;

           case 'y': System.out.println("Your character has Flown"); break;

           default: System.out.println("Pause Menu has appeared"); break;

       }

You might be interested in
What were the technological innovations that allowed for the rapid expansion of the railroads?
liraira [26]

Answer:

There are different phases of railroad expansion with the innovations in technology.

Explanation:

Few of the technological innovations are described below that leads in railroad expansion more rapid.

1. Centralized Traffic control (CTC) is introduced in 1960's that is used to control the traffic on railroads using different signal control.

2. In 1990's after computer technology involvement, railway ticket and reservation system is automate and being centralized. That makes the railroad expansion improve.

3. Bullet train technology has been introduced, that makes the railway trains more faster.

4. Electric trains has been introduced to use green energy and reduce the dependency on the fuel to make environment clean and green.

5 0
3 years ago
Which of these can a worksheet within a spreadsheet contain?
Lisa [10]
<span>d) all of these is your correct answer</span>
3 0
3 years ago
Read 2 more answers
A customer in Lowe's needs help. Matt works in shipping and receiving. It isn't Matt job to work with the customer, but he knows
klio [65]

Answer:

40

Explanation:

hhhhhjjjj

5 0
3 years ago
Read 2 more answers
What does coding mean​
NeTakaya
The process or activity of writing computer programs.
3 0
3 years ago
Read 2 more answers
Reading is the process of transferring data, instructions, and information from memory to a storage medium.
maksim [4K]
True, the computer will read from, say, a blu-ray and then transfer it to your RAM to before writing it to your hard drive and then, through the various other wonders of computers, it can be displayed on your monitor.
8 0
3 years ago
Other questions:
  • Your brother is starting 9th grade next year and is thinking about going to college. What step would you recommend he take?
    14·1 answer
  • Bcghxdfghncfghndfgxdfgjfjgktyerdgftguj
    8·2 answers
  • What is one way to maintain Internet safety? a) avoid interacting with people on the Internet. B) avoid giving out information a
    7·1 answer
  • Over the past few years a very definite need has arisen in the electrical trades for:
    15·1 answer
  • pDevices used to prevent data from being written to a disk can connect to a computer through FireWire, SATA, PATA, and SCSI cont
    10·1 answer
  • This program will store roster and rating information for a soccer team. Coaches rate players during tryouts to ensure a balance
    5·1 answer
  • Write a for loop to print all NUM_VALS elements of array hourlyTemp. Separate elements with a comma and space. Ex: If hourlyTemp
    11·1 answer
  • What is emerging as a major business area of innovation that offers a flexible collection of computers on the internet that can
    6·1 answer
  • Why would a programmer use a flow chart? (Edge2020 Coding Critical Thinking Questions)
    9·1 answer
  • What are good reasons to do yearly disaster recovery testing? check all that apply
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!