Write a program that lets the user play the game of rock

Assignment Help Programming Languages
Reference no: EM131265996

Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows.

1. When the program begins, the user is asked to seed the random number generator, and 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 computers choice yet.)

2. Using a menu the user enters his or her choice of rock, paper, or scissors at the key-board.

3. The menu displays the options

1-rock

2-paper

3-scissors

4. The computers choice is displayed.

5. A winner is selected according to the following rules:

If one player chooses rock and the other player chooses scissors, then rock wins. (The rock smashes the scissors.) If one player chooses scissors and the other player chooses paper, then scissors wins. ( Scissors cuts paper.) If one player chooses paper and the other player chooses rock, then paper wins. ( Paper wraps rock.) If both players make the same choice, the game ends in a tie

Be sure to divide the program into at least the following methods

1. Display the menu, and get the users response

2. Get the random number

3. Determine the winner

4. Output the winner.

Reference no: EM131265996

Questions Cloud

Appraisal value of this acquired land : On May 26, 2012, the Georgia Corp. acquired a piece of land by issuing 60,000 shares of its $9 par value common stock. The list price of the land was $625,000 and on May 26, 2012, Georgia's common stock was actively trading in the marketplace at $10 ..
Describe the effects of paralysis on the skeleton : 1. Following a severe spinal cord injury in the lumbar region, the voluntary muscles of the legs and hips will be paralyzed. Describe the effects of paralysis on theskeleton.
Find the flux/pole of the rotating flux density wave : If the stator resistance and leakage reactance are assumed negligible, find the flux/pole of the rotating flux density wave.
What are the prime costs and conversion costs per unit : What is the product unit cost for Job 14, which consists of 300 units and has total manufacturing costs of direct materials, $4,500; direct labor, $7,500; and overhead, $3,600? What are the prime costs and conversion costs per unit?
Write a program that lets the user play the game of rock : Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows.
Context of the dynamic stochastic : Modern macroeconomic models can be distinguished by their impulse, amplification, and propagation mechanisms. Within the context of the dynamic stochastic general equilibrium model, identify those mechanisms and discuss their merits and weaknesses..
Interest and principal will be repaid on the maturity date : A 1- year, 6%, $30,000 promissory note was signed at the Citizens National Bank. Interest and principal will be repaid on the maturity date of Feb 1, 2014 _This is for the month of Feb 2013 -Im trying to figure out the amount. Cash: ? Note..
Find the per phase emf if the conductors are connected : A 50-Hz synchronous salient pole generator is driven by a hydro-electric turbine at a speed of 125 rpm. There are 576 stator slots with two conductors per slot. The air-gap diameter is 6.1 m and the stator length is 1.2 m. The sinusoidally distrib..
Action the overall economy will suffer : An interesting paradox called the "Paradox of Thrift" arises when households become concern about their future and attempt to increase their saving. As a consequence of such action the overall economy will suffer. Explain. Do you agree with thi..

Reviews

Write a Review

Programming Languages Questions & Answers

  Nested if functions along with vlookup function

The Vlookup function returns a #n/a! error if no lookup value is supplied, and various other errors whne invalid keys are entered. Use a combination of three levels of nested if functions, and other functions to avoid these problems.

  Program to displays the sum of the integer numeric values

Design a program that displays the sum of the integer numeric values stored in two arrays, in a tabular format. The design defines two arrays of the same size (each array has 10 elements).

  Javascript program that allows a user to input three integer

Write a JavaScript program that allows a user to input three integers using text boxes in a form. (Hint: You need to use the built-in parseInt function to convert the input strings to integers.)

  Calculate and display the grade point average

Different program control statements in a programming language - Demonstrate the use of arrays with a programming language

  Writes a function that takes a list of integers

Using ML writes a function that takes a list of integers as argument and returns a pair consisting of the sum of the even position and the sum of the odd positions of the list. You should not use auxiliary functions

  Ms word versus other processing program

MS word Versus other processing program

  List the details of employee in database table

List the name, city, state, and phone number of each customer not located in Washington (state). Organize the list alphabetized by state and city within each state. Within each city, order the customer names alphabetically with last name followed by ..

  In what stage of the programming process are flowcharts used

In what stage of the programming process are flowcharts and pseudocode used

  Design your program to perform the required tasks

Design and develop a console program that receives inputs from user and display correct outputs and manipulate arithmetic calculation via programming

  Develop pseudo-code for program to retrieve bytes

Develop the pseudo-code for a program that will retrieve 2 bytes (NUM1 and NUM2) from memory, determine which is closest to the numeric value 50.

  Explain how is recursion and iteration used in programming

question 1 how is recursion and iteration used in programming? provide examples of the various types of recursion and

  Write shell script to determine whether given file exist

Write shell script to determine whether given file exist or not, file name is supplied as command line argument, also check for sufficient number of command line argument

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