1. Please upload your source code (java files) on myLeo Online (D2L Brightspace)
Objectives
· Use the static methods and static fields.
· Use the method-call/return mechanism.
· Use the random-number generation.
· Overload methods.
Problem Specification
Write a program that lets a user play "Rock, Paper, Scissors" against the computer or computer against computer.
In user-computer game, the program should ask the user to choose one of the three choices, and then the computer randomly picks one (without knowing what the user has chosen). For this problem, the user should be asked to enter an integer: 1 for rock, 2 for paper, 3 for scissors. Rock beats scissors, scissors beats paper, paper beats rock. The program should say who wins, and then keep playing until someone (the user or the computer) has won 5 rounds. The computer needs to keep track of the current score and should also display it before each round.
In computer-computer game, play for 100 rounds and display which object won majority of the times.
Design Specification
· Create Java class RPS.
· Create static variables for storing Score1 and Score2.
· Create a static method getRandom to get random integer between 1 and 3.
· Overload play method like in the below screenshot.
· Play() is for computer vs computer, play(userchoice) is for user vs computer.
Example:
Your program should work for both modes.
Mode 1:
Mode 2: