Question: C++ : Write a program that will play this game against the computer. The game should end once there is a winner. If the game

C++ : Write a program that will play this game against the computer. The game should end once there is a winner. If the game is a tie then the program must make the user play again, until there is a winner. Once there is a winner, the program (game) must end. When the program begins, a random number is created between 1 and 5. These values will be used as follows:

1 Rock

2 Paper

3 Scissors

4 Lizard

5 Spock

Use a menu to prompt the user for their choice, using the same values as above. The program should then display the computer's choice and indicate who has won. A winner is selected using the following rules:

Scissors cut paper

Paper covers rock

Rock crushes lizard

Lizard poisons Spock

Spock smashes (or melts) scissors

Scissors decapitate lizard

Lizard eats paper

Paper disproves Spock

Spock vaporizes rock

Rock breaks scissors

The program must be divided into the following functions at least:

int getUserChoice()

int getComputerChoice()

void determineWinner(int, int)

void displayChoice(int)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!