Java program: Rock, Paper, Scissors
Rock, paper scissors is a well known game in the United States. Two players count 1, 2, 3, then each throw down one hand as a rock (closed fist), paper (all fingers out), or scissors (two finders out).
The winner is as follows:
- Paper beats rock. (Paper covers rock)
- Scissors beats paper. (Scissors cuts paper)
- Rock beats scissors. (Rock crushes scissors)
- If the two are the same it is a tie.
Your program will do the following:
- Ask the user to pick rock, paper or scissors.
- The program will randomly pick rock, paper, or scissors.
- The program will tell the user what the computer picked.
- The program will announce the winner or tie.
You can test the program by using an assigned value for the computer choice, but the final program should use a random choice for the computer.
Please submit one Word document that includes the source code, at least 3 screen shots of the output showing each choice for the user, and a truth table showing all possible combinations and the result.
In addition please submit the Java file that you can find in the src folder of the project.
Check list
- There is a comment with your name and the name of the program.
- The program displays the correct result with no error messages.
- All messages to the user make it clear what they should enter or what the result is.
- The user enters a choice of rock, paper or scissors.
- The computer pick rock, paper or scissor randomly.
- You have created a truth table showing all possible combinations and the results.
- The results are correct for all possible combinations according to the truth table.
- You have created a Word document with your name, the name of the project, a truth table showing all possible combinations, the source code, and screen shots showing good test data.
- You have submitted both the Word document and the Java file with the source code in Blackboard.
Grading Rubric
Rubric |
Points |
Program works correctly, no errors |
5 |
Comments, good names, indented |
1 |
Truth table |
2 |
Word document and Java File |
1 |
Screen shots show good test data |
1 |
Standards
- Your program must start with comments giving your name and the name of the assignment.
- If there are any variables your program must use good variable names.
- All input (if any) must have a good prompt so that the user knows what to enter.
- All output must clearly describe what is output.
- The program must be your own work.
- All assignments for this class must be submitted in Blackboard.
- You must submit one word document that includes the source code, and screen shots of good test data.
- Assignments may be submitted up until midnight on the due date.
- You may use the assignment submission page to ask for help, but make sure that you clearly indicate that you are asking for help and not submitting for grading.
If you do not receive a perfect score you may resubmit it as long as it is resubmitted within 3 days.
Assignment IndexThis web site, and all pages therein, are the sole property and responsibility of Zebra0.com.
It is not endorsed, sponsored, or provided by or on behalf of Montgomery College.