Question: Write a C + + program that will complete the following steps: 0 . Declare variables a . P 1 _ int _ val, P
Write a C program that will complete the following steps:
Declare variables
a Pintval, Pintval as type int
b Pstringval, Pstringval as type string
Use srand timeNULL and rand to assign a random integer between to
Pintval and Pintval
Based off of the numerical values stored inside of Pintval and Pintval, use if else, and else if
statements to store the following strings in Pstringval, Pstringval
intval stringval
rock
paper
scissors
Output the stringvals of both players to the console.
Use a function to compute and return an integer value to determine who won. Try to complete this
step using less than operations.
This function will take in two integers as parameters:
P this will store a copy of Pintval
P this will store a copy of Pintval
This function will return an integer value to indicate a tie or which player won. The following defines
the possible return values:
Tie
Player
Player
Based off of what the function returned in Step Output either Tie or a message stating who won
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
