Display the counts when the player ends the game

Assignment Help Computer Engineering
Reference no: EM132125637

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.

Reference no: EM132125637

Questions Cloud

Write the array a at the start of the iteration : Write the array A at the start of the iteration j=5 of the for loop. What is the value of i at the start of the iteration j=6 of the for loop?
How to run the test in the bluehill program : What are the typical items (input or control) you should include in the test method in the Bluehill program?
Draw the first seven rooted fibonacci trees : How many vertices, leaves, and internal vertices does the rooted Fibonacci tree T_n have, where n is a positive integer? What is its height?
Estimate of the root x1 most nearly is : The angle the line tangent to the function f(x) makes at x = 3 is 57 degrees with respect to the x-axis.
Display the counts when the player ends the game : Keep a count of the number of times the player won, lost, and tied. Display these counts when the player ends the game.
Java collections framework : In Ruby, the Hash class inherits from Enumerable, suggesting to a programmer that Hashes are collections.
Discuss the roles and functions of is governance : Discuss how the roles and functions of IS governance are changing or should change, as a company considers Cloud and Big Data migrations
Will the packet be forwarded into its base network : What is the network mask used by the router? (in dotted decimal or binary). What is the network portion of the incoming packets IP address?
Determine the average temperature value : Plot the Temperature vs. Time graph. Note that you must adhere to the requirements of a proper engineering plot.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Give overview on emerging trends in wearable computing

Give a detailed explanation of Wireless Access Protocol (WAP). Explain with the help of some examples.

  Use information from the modular background readings as

use information from the modular background readings as well as any good quality resource you can find. please cite

  Show the new class header for movie and then implement

show the new class header for Movie and then implement the compareTo method as follows.

  Create well design modular program based on design technique

Create a well designed modular program based on design techniques taught. Use good naming conventions on all objects, variables, procedures, functions, etc. Make sure all functions and procedures are called "down". Meaning a top-down modular approach..

  Show how to augment the model to build a model

Show how to augment the model to build a model P(X,Y| ?, ?') = P(X|?)P(Y| X, ?') so that it satisfies the missing at random assumption.

  Developing a monthly budget structure

Write down a program which declares a MonthlyBudget structure with the member variables in order to hold each of these expense categories.

  Write down a program that requests an integer

The Twelve Days of Christmas. Each year, PNC Advisors of Pittsburgh publishes a Christmas Price List. See Table 6.11. Write a program that requests integer from 1 through 12 and then lists the gifts for that day along with the day's cost.

  Write a script that looks in the entire file system

Write a script that looks in the entire file system to locate a filename supplied as argument. If the file is found script should display its absolute pathname.

  Which of the frames would be sent out from this port

We have 4 devices connected to an 8-port Hub. Each device is numbered starting with 0, and each port of the Hub is also numbered starting with 0.

  What is the difference between formative assessment and

1 in a 750-1000 word essay draft your proposal to utilize software to support assessment in the classroom. consider the

  Prompt the user for the details of a credit card transaction

To practice UDP programming, including the use of the socket, bind, sendto, and recvfrom system calls.

  Reducing the radiation component of heat transfer

In an ordinary double-pane window, about half of the heat transfer is by radiation. Describe a practical way of reducing the radiation component.

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