Java programming, Basic Computer Science

Write a program that lets the user play the game Rock, Paper, Scissors against the computer. The program
should work as follows:
? When the program begins, the results of the previous run of the program (ie - how many wins the user
had versus how many wins the computer had) are read from a file and displayed. Note - if this is the
very first run of the program then a welcome message is displayed.
? A method is called to determine the computer''s choice. In the method, a random number in the range of
1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2,
then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Don''t
display the computer''s choice yet).
? The user enters his or her choice of "rock", "paper", or "scissors" at the keyboard. (You can use a menu
for user input if you prefer). Remember to validate user input.
? The computer''s choice is displayed.
? A method is called to determine the winner according to the following rules:
o If one player chooses rock and the other player chooses scissors, then rock wins. Rock
smashes scissors.
o If one player chooses scissors and the other player chooses paper, then scissors wins. Scissors
cut paper.
o If one player chooses paper and the other chooses rock, then paper wins. Paper covers rock.
o If both players make the same choice, the game must be played again to determine the winner.
? A count of the number of wins for the user and for the computer is kept.
? The user is given the opportunity to play again.
? When the user is finished playing, the count values are written to the screen and to an output file for
later use.
Posted Date: 4/6/2012 12:51:38 AM | Location : United States







Related Discussions:- Java programming, Assignment Help, Ask Question on Java programming, Get Answer, Expert's Help, Java programming Discussions

Write discussion on Java programming
Your posts are moderated
Related Questions
1. The volume of a pyramid is taken from the formula: V = 1/3 x AREA OF BASE x ALTITUDE Given the dimensions of a pyramid, calculate the cost of materials for making that pyrami

The TCP/IP networking protocol suite is so basically named for two of its very most and important protocols: Transmission Control Protocol online tutoring Indication Manage

Create a database,show all ojectives and give a fruitful introduction and also state how it will be implemented

can you help me to do my assembly program homework


One of the first caveats programmers come across when learning Python is the reality that there are no braces to point to blocks of code for class and function definitions or flow

FUNDAMENTALS OF COMPUTERS 1. Describe the importance of video in multimedia. What are some of the tips to keep in mind while making video for the web? 2. Specify the steps t

Finding someone who doesn''t use some aspect of Microsoft Office on a daily basis is difficult. Whether it is Outlook for email,Word for creating and editing documents,or Excel f

identify application software from the list? ms excel linux internet explorer adobe photshop sound card driver window disk manger adobe dream weaver windows file explorer

Manipulate the following Boolean expression in such a way so that it can be implemented using exclusive-OR and AND gates only. AB''CD'' + A ''BCD'' + AB''C''D + A''BC''D