Java programming, Basic Computer Science

Assignment Help:
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.

Related Discussions:- Java programming

Explain the important features of creational patterns, Question 1 Explain ...

Question 1 Explain the role of object oriented designers in developing a software system Question 2 What are the four essential elements of design patterns? Explain Question 3

Example of flowcharting, Example of flowcharting: Example Problem s...

Example of flowcharting: Example Problem statement: To find out whether a given number is even or odd. Algorithm: Step 1 Start Step 2 INPUT the number n  Step 3

Explain the characteristics of vector processing, Question 1 Draw the bloc...

Question 1 Draw the block diagram of von Neumann Architecture and explain about its parts in brief Question 2 Draw the block diagram of Intel 8085 CPU organization and explai

Mini computers and micro computers, Mini Computers and Micro Computers: ...

Mini Computers and Micro Computers: The mini computers are intermediate in power, and may function as small mainframe computers. They are often dedicated to a particular purpo

Ip addressing assignment help, An IP address consists of 4 contiguous octet...

An IP address consists of 4 contiguous octets and is generally written in Dotted Decimal Notation in the form: A.B.C.D Where: A represents the most significant octet, D the leas

Specify the steps to creating a powerpoint presentation, FUNDAMENTALS OF CO...

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

Operating system, Operating System: Operating  System is the software ...

Operating System: Operating  System is the software that manages all the computers' resources to optimize its performance provides common services for efficient execution of v

Internet, Explain how the internet works

Explain how the internet works

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd