Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Rock, Paper, Scissors (Please make sure it compiles and include output in answer.)

You will implement a rock-paper-scissors game.

The player enters 1 for Rock, 2 for Paper, or 3 for Scissors.

The computer randomly selects one of the three itself.

The program displays computer and player choices and who won (or if it is a tie).

Ask the player if they would like to play again.

Implement the following features in addition to the game play:

Keep a count of the number of times the player won, lost, and tied. Display these counts when the player ends the game.

Keep a count of the number of times the player selects rock, selects scissors, and selects paper. When the player stops playing display these counts.

Use the rand() function to generate the computers selection:

I.E.

/* initialize random seed. Do this only once at the beginning of the main-function */ srand ( time(NULL) ); int randomNumber; // this variable will hold the random number /* generate secret number: between 1 and 10. Change the 10 to a different value to */ generate random numbers up to that value */ randomNumber = rand() % 10 + 1;
When the player ends the game, display who won the most rounds. Also display the object the game winner won with the most.

Tell the player what they should have chosen to win most of the time. For example, if the computer chose rock 7 out of the 10 times then the player should have chosen paper to win most of the time.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93113103

Have any Question?


Related Questions in Computer Engineering

Question suppose an algorithm requires cn2nbspoperations

Question : Suppose an algorithm requires cn 2  operations when performed with an input of size n (where c is a constant). a. How many operations will be required when the input size is increased from m to 2m (where m is ...

Costs are rising for all kinds of medical care the mean

Costs are rising for all kinds of medical care. The mean monthly rent at assisted living facilities was reported to have increased 27% over the last five years to $3886 (the wall street journal, October 27, 2012. aussume ...

Assignmentnbspon information systems audit and

Assignment  on Information Systems audit and controls Assignment purpose: Elaborate on the different types of control that are applied in a hospital (Preventive, detective and corrective control). Evaluate the logical an ...

Question using an organization of your choicedevelop a

Question: Using an organization of your choice: Develop a Complete Disaster Recovery Plan to be submitted to the executive board of your company. Please note that this is a formal writing, all references (peer-reviewed) ...

Scruffie the cat has 15 to spend each month on cat toys

Scruffie the cat has $15 to spend each month on cat toys, which cost $3 each, and cat treats, which cost $1.50 each. Draw a budget line to show the combination of each good that scuffie can afford if she spends her entir ...

Aa stock will pay dividends of 3 4 and 9 over the next

aA stock will pay dividends of $3, $4, and $9 over the next three years, and then increase dividends at a rate of 3% afterwards. Its required rate of return is 15%. What is the value of the stock? Round to the penny.

A survey is taken of people in the class of favorite flavor

A survey is taken of people in the class of favorite flavor of ice cream among a forced choice of chocolate, vanilla, or strawberry. 70% prefer chocolate, 20% prefer vanilla, and 10% prefer strawberry. a) What is the ent ...

Suppose there are three decks of cards on the table a

Suppose there are three decks of cards on the table, a number is written on each card. And each deck is sorted in decreasing order (The maximum value is on the deck in top). The goal is to find the minimum value between ...

Should you perform a log transformation on a categorical

Should you perform a log transformation on a categorical (nominal) variable, or can you only do that for continuous variables?

Question suppose a computer using direct mapped cache has

Question : Suppose a computer using direct mapped cache has 2 20 words of main memory and a cache of 32 blocks, where each cache block contains 16 words. a. How many blocks of main memory are there? b. What is the format ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As