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
Discuss whether the redundant data should be addressed prior to beginning the wireless network architecture project, in coordina
victus00 [196]

Answer:

Before the project

Explanation:

We must o administrate and elaborate a prioritization about this redundant data, if we started after, we're going to lose a general view about the data, and when we're talking about redundant data always must be prevention and not monitoring, because any network must have redundant data, if we try to fix a network or database with this problem, we could delete delicate data.

4 0
3 years ago
Which of the following are examples of software? (Select all that apply)
olchik [2.2K]
Put a photo or something
8 0
3 years ago
Read 2 more answers
Which best compares and contrasts visual and performing arts? Both careers use communication skills; however, people involved in
Vlad1618 [11]

Answer:

Both careers speak to an audience; however, people involved in the performing arts speak only to a live audience.

Explanation:

sorry im late but im not sure

3 0
4 years ago
Read 2 more answers
To build a framework for security policies and controls, one can use the following approach: 1) document the concepts and princi
serious [3.7K]

Answer:

n/a

Explanation:

4 0
3 years ago
William wants to create a document using a DTP. What time-saving techniques can he use?
Verdich [7]
Projective ecodynamic blueglocose
6 0
4 years ago
Other questions:
  • Write a program LotheryPrinter that picks a combination in a lottery. In this lottery, players can choose 6 numbers ( possibly r
    9·1 answer
  • 3.3 Code Practice: Question 1
    6·1 answer
  • Which of the following should you NOT do when using CSS3 properties to create text columns for an article element? a. make the c
    12·2 answers
  • Why you think Operating System is pivotal in teaching and learning.
    13·1 answer
  • Declare a Scanner reference variable fileInput, and assign it a newly created Scanner object that is associated with a file name
    10·1 answer
  • The mouse pointer becomes different shapes depending on the pointer s location and locations you click on the screen. true false
    6·1 answer
  • g Write a recursive function all capital (L,start ,stop) that takes a string L and two integers. It returns a Boolean (True/Fals
    8·1 answer
  • True/False: not is evaluated first; and is evaluated next; or is evaluated last.
    13·1 answer
  • What is it called when u want 2 or more cells into 1
    14·2 answers
  • Which of the following items can you locate in a document using the navigation pane? Choose the answer.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!