Question: can you please provide me with the source code in C++ for the program below? Please include pseudocode at the begining of the code as

can you please provide me with the source code in C++ for the program below? Please include pseudocode at the begining of the code as a multiline comment.

In this assignment, you will create the game called Rock Paper Scissors game with a little twist to it. In this version, you will also include Lizard and Spock. This means the players have the choice of Rock, Paper, Scissors, Lizard, and Spock.

The program will play the game between a user and the computer. The game will continue until there is a winner to the game, the user should not be prompted to see if they want to continue when there is a tie in the game. 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.

The computers choice will be a random number generated by the program using the random number generator. The number must be limited to the following values:

Rock

Paper

Scissors

Lizard

Spock

Use a menu to prompt the user for their choice, using the same values as above. The program will then display the computers choice and the users choice in a textual format. Meaning if the computer random number is 3 then it should display something like The computer choice is Scissors.

The program will then determine if there is a winner or a tie. If there is a winner the program must tell the user, the rule the winner won by (listed below).

A winner is determined 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 functions with at least the following functions:

int getUserChoice()

Displays a menu of choices

Prompts the user for their choice from the menu

Return the users choice as an integer to main

int getComputerChoice()

Use the random number generator to create the computer's choice

returns the computer's choice as an integer to main

bool determineWinner(int userChoice, int compChoice)

Uses the two parameters to determine if there is a winner based on the rules provided above.

Return true if there is a winner, false otherwise (used to determine if tie so that the game can continue in main).

If a winner, then the correct message must be display indicating who won and by what rule.

void displayChoice(int choice)

To be used display user choice.

To be used to display computer choice.

Should be called two times o Display the choice as text not numeric (Such as Rock for choice of 1).

The program must indicate whose choice it is. Does not need to be done in the function

Function just displays the choice, a single word.

Pseudocode must be provided in the comment block at the top of the file.

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!