Question: Hello I need help creating this program. The code must be in JAVA. Write a program that simulates Rock, Paper, Scissors. Rules of the game
Hello I need help creating this program. The code must be in JAVA.
Write a program that simulates Rock, Paper, Scissors. Rules of the game are as follows:
Rock smashes Scissors
Paper covers Rock
Scissors cuts Paper
You are to write a program that plays the game against the computer (10pts).
Allow the user to input their name (5pts).
The computer should choose an object randomly and your program should prompt the user to enter his/her choice. (5pts) OR with a *GUI (10pts)
You are at liberty to have the user enter a number or the string.
Use a decision structure of your choice to determine a winner (15pts).
Allow the user to play a set amount of times (5pts) OR allow the user to determine the number of times they will play (15pts).
The program should then declare the winner, whether user or CPU and how the winner won the game. (5pts) OR with GUI (10pts)
Your program should keep track of the number of wins and losses for each and also the number of ties. (15pts) OR display the results GUI (20pts)
Output their name when giving them the summary of their games (5pts) OR GUI (15pts).
Anything unique after completing all the requirements or a more creative approach (5pts).
*GUI - Graphical User Interface, any one of your choice (JOptionPane)
Simplest Input and Output (you are encouraged to make it more interesting)
Sample Output: Please enter your name.
Sample Input: Marquez
Sample Output: Please choose, Rock, Paper, or Scissors (Explain the game to them here)
Sample Input: Either a 1, 2 or 3 OR the words "Rock", "Paper", "Scissors"
Sample Output: The computer chose Rock and You chose Paper, you win.
Sample Output: Would you like to play again?
Sample Output: David, You won 1 of 1 games.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
