Computers and Technology

Write this program using an IDE. Comment and style the code according to CS 200 Style Guide. Submit the source code files (.java) below. Make sure your source files are encoded in UTF-8. Some strange compiler errors are due to the text encoding not being correct. This lab asks you to create a text game Rock Paper Scissors. The rule of the game: There are two players in this game and they can choose Rock, Paper, or Scissors each time. Rock beats Scissors, Paper beats Rock and Scissors beat Paper. Your program needs to prompt a user to choose an action (Rock, Paper, or Scissors) and save their choice. The program randomly chooses an action (Hint: use .nextInt() to generate random integers in the range of [1,3]. 1 indicates Rock, 2 indicates Paper and 3 indicates Scissors.) Then the program determines who is the winner. When input is R Please select one of [R/P/S]: You chose: Rock I chose: Scissors Rock beats scissors - you win! If the user enters the lowercase, your program can still recognize. When input is p Output should be Please select one of [R/P/S]: You chose: Paper I chose: Scissors Scissors beat paper - you lose! If the user enters invalid input, the program will give an error message and set the default choice as Rock When input is v Output should be Please select one of [R/P/S]: Invalid choice! Defaulting to Rock. I chose: Scissors Rock beats scissors - you win! If the user has the same result as the computer, your program should output: A Tie!

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 16:30, mesposito
Technician a says that a dry sump system uses no oil storage sump under the engine. technician b says that a wet sump system uses no oil storage sump under the engine. who is correct?
Answers: 3
image
Computers and Technology, 22.06.2019 19:30, mitalichavez1
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 3
image
Computers and Technology, 22.06.2019 22:30, hmontalvo22
Who needs to approve a change before it is initiated? (select two.) -change board -client or end user -ceo -personnel manager -project manager
Answers: 1
image
Computers and Technology, 23.06.2019 02:30, chaaaa
People with high self-esteem: accept their strengths and weaknesses. believe that failed experiences are failures of their whole self. feel good about who they are only when they reach total success. need positive external experiences to counteract negative feelings that constantly plague them.
Answers: 1
Do you know the correct answer?
Write this program using an IDE. Comment and style the code according to CS 200 Style Guide. Submit...

Questions in other subjects:

Konu
Spanish, 06.02.2021 23:50
Konu
Mathematics, 06.02.2021 23:50
Konu
English, 06.02.2021 23:50