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

  Design a class named pet, which should have following fields

The type field holds the type of animal that is the pet. Example values are "Dog", "Cat", and "Bird".

  Program to output circle-s radius-diameter-circumference

Write a program to prompt the user to enter center and a point on circle. Program must then output circle's radius, diameter, circumference, and area.

  Read a file and store the result in a string in java

Read a file and store the result in a string in java?

  Create the css for a website

Create a file called lab1.html which contains the HTML of a blog page. Create another filelab1.css which is linked from lab1.html , and which contains all the style formatting of thedocument. These files must match the specification given below.

  Enhanced cleverskater

Create an cleverSkater. Use that code as the basis for your World. In addition to the skateForward, spin and skateAround methods, create skateBackward and jump class-level methods.

  Develop a console application that grades a multiple choice

In this assignment, you will redo Assignment 1 using functions and also extend its functionality. Like Assignment 1, you will develop a Console Application that grades a multiple choice test with 10 questions taken by 8 students.

  All variables that aren''t numeric variables

All variables that aren't numeric variables

  Create a default string of cars in main

Build the default constructor first. Create a default string of cars in main. Build an output function, similar to the old one, but dereferrencing the pointers.

  Prompt for user login to begin using the system

Suggest an application system which is able to perform some arithmetic computations, like commission system, encryption system, timer system, etc, from anyone of the following industry.

  Primitive and user-created methods of programming

Differentiate between primitive and user-created methods of programming. Give a scenario in which each method would be preferred over the other

  Which functions perform assignment score to private member

Consider this class definition: class quiz { public: quiz( ); int f( ); int g( ) const; private: double score; }; Which functions can carry out an assignment score=1.0; to the private member variable score?

  Write program which reads three integer from input dialogs

Write down the program which reads three integer. Integers are entered from input dialogs and stored in variable num1, num2, and num3, respectively.

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