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
whats the out put of int main(){ int n=310; funcone(n); functwo(&n); cout return 0; } void funcone(intn) n=240; } void func two(intn*) { n=120; }

Question: Using a questionnaire is a popular way commonly used to evaluate interfaces. (a) Describe advantages of using questionnaires as a means to evaluate interfaces.

what are slides how do you put slides on powerpoint

High level languages: High level languages (converted to machine code by compiler or equivalent) are much easier to program, as well as to understand. Several high level langu

I need help! import cgi, cgitb cgitb.enable() HTML_head = ''Content-type: text/html\n\n'' HTML_top = '''''' Restaurant Results '' Restaurant Results '''''' HTML_bottom =

Questions 1) Polynomial Integrals Problem: Write an X86-series assembly language program that calculates and prints out (in a nice form) the indefinite integral of a simple polynom

Problem 1 Identify important elements of Multimedia and explain with example. Stating important elements of Multimedia with example of each Problem 2 Explain a

Question 1 Bring out the advantages of Linux Operating systems Question 2 Match the Symbols with their respective file types              Symbol               File N

Laser Printers: These printers can print a whole page at one command, offer highest quality and can combine text, graphics, etc. They are generally restricted to A4 paper and

Define Levels of Abstraction in a DBMS, explain briefly, Conceptual Schema, Physical Schema, External Schema