Академический Документы
Профессиональный Документы
Культура Документы
Summer 2015
Assignment #2
June15, 2015
Programming Assignment 2:
Selection Control Structures - Mathematical Functions and Strings
Total Points (60 pts) - Due Sunday, June 21 at 11:59 PM
CS1A
Summer 2015
Assignment #2
June15, 2015
Rock-paper-scissors is a hand game usually played by two people, where players simultaneously
form one of three shapes with an outstretched hand. The "rock" beats scissors, the "scissors" beat
paper and the "paper" beats rock; if both players throw the same shape, the game is tied.
Rock, Paper, Scissors (see http://en.wikipedia.org/wiki/Rock_paper_scissors) is a popular game.
Here are sample runs:
Sample Run 1:
Let's play Rock, Paper, Scissors!
Game Menu
--------1) Rock
2) Paper
3) Scissors
4) Quit
Enter your choice: 1
You selected: Rock
The computer is paper. You are rock. You lost
Sample Run 2:
Let's play Rock, Paper, Scissors!
Game Menu
--------1) Rock
2) Paper
3) Scissors
4) Quit
Enter your choice: 2
You selected: Paper
The computer is paper. You are paper too. It is a draw
CS1A
Summer 2015
Assignment #2
June15, 2015
Sample Run 3:
Let's play Rock, Paper, Scissors!
Game Menu
--------1) Rock
2) Paper
3) Scissors
4) Quit
Enter your choice: 1
You selected: Rock
The computer is scissor. You are rock. You won
Sample Run 4:
Let's play Rock, Paper, Scissors!
Game Menu
--------1) Rock
2) Paper
3) Scissors
4) Quit
Enter your choice: 2
You selected: Paper
The computer is scissor. You are paper. You lost
Sample Run 5:
Let's play Rock, Paper, Scissors!
Game Menu
--------1) Rock
2) Paper
3) Scissors
4) Quit
Enter your choice: 1
You selected: Rock
The computer is Rock. You are Rock. It is a draw
Sample Run 6:
Let's play Rock, Paper, Scissors!
Game Menu
--------1) Rock
2) Paper
3) Scissors
4) Quit
Enter your choice: 3
You selected: Scissors
The computer selected: Rock
The computer is Rock. Scissors. You lost
CS1A
Summer 2015
Assignment #2
June15, 2015
Submission:
The submission must include .java files /run output.
README.doc (you must edit this and insert your own screen shot or a sample run of
each program)
Turn in your README.doc and your Java source code files electronically from the
Assignment link on the Etudes system. Submit the following files:
1. BankCharges.java
2. RockGame.java
3. README.doc (you must edit this and insert your own screen shot or a sample run of
each program)