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
A sonar operator on a battleship looks at a display that contains a spatial layout of the distribution of echoes from the surrou
ankoles [38]

Answer:

The sonar operator looks at the display a forms an internal representation of the strength of the evidence that a submarine is present. If this exceeds an internal, subjective threshold,the sonar operator tells the captain that a submarine is present.

8 0
3 years ago
Which of these categories of computer software can add thousands of dollars to the cost of a computer system?
Radda [10]
Specialized software. hope this helps
6 0
3 years ago
What can search the internet and select elements based on important words
Lana71 [14]

The item in question is known as a web search engine. These services will crawl websites and gather information about web pages to present to the searching user based on the search terms compared to the content of the webpage.

7 0
2 years ago
Hard links need to reside on the same filesystem as the target, whereas symbolic links need not be on the same filesystem as the
ale4655 [162]

Answer:

True

Explanation:

3 0
3 years ago
Which two hardware features would a technician monitor within the bios if a computer was suspected of overheating?
Firdavs [7]
I would say probably the CPU Fan and the CPU clock speed 
4 0
2 years ago
Other questions:
  • You are given a string of n characters s[1 : : : n], which you believe to be a corrupted text document in which all punctuation
    12·1 answer
  • Attention merchants define
    5·1 answer
  • A client contacted you to request your help in researching and supplying the hardware necessary to implement a SOHO solution at
    9·1 answer
  • Contains the instructions your computer or device needs to run programs and apps
    5·1 answer
  • Which cell formatting is most likely to use $?
    5·1 answer
  • When can you access the BIOS setup utility?
    14·1 answer
  • Pick a web browser (a leading one or perhaps a lesser-known one that you use) and examine the Privacy and Security features and
    10·1 answer
  • Please help me willgive u brainliest​
    14·1 answer
  • how do i turn off itallics on a school chromebook i accidentally turned them on in another tab and i dont know how to undo them
    7·1 answer
  • Which of the following best describes your sequence of actions when developing a web page?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!