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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started