Write a Pseudocode to play Rock-Paper-Scissors Game 5 times. Determine who the final winner is. For each game, you may need two input variables: myHand and YourHand. They can have the values of “R”, “P”, and “S”. Use a For loop to play the game 5 times: For times = 1 to 5 step 1 Endfor You also need to declare two additional variables: timesIWon and timesYouWon to record the total number of times I won and the total numbers of times you won. For instance, if you win one of the five games, then you need to increase value of the variable thisYouWon by 1: timesYouWon = timesYouWon + 1; When the loop ends, you need to use a decision making to determine who the final winner is: If tiimesIWon == timesYouWon TheWinner = “TIE” Else if …. TheWinner = “YOU” Else TheWinner = “ME” Display the final winner. The values can be “YOU”, “ME”, and “TIE”.
Write a Pseudocode to play Rock-Paper-Scissors Game 5 times. Determine who the final winner is.
For each game, you may need two input variables: myHand and YourHand. They can have the values of “R”, “P”, and “S”.
Use a For loop to play the game 5 times:
For times = 1 to 5 step 1
Endfor
You also need to declare two additional variables: timesIWon and timesYouWon to record
the total number of times I won and the total numbers of times you won. For instance, if you win one of
the five games, then you need to increase value of the variable thisYouWon by 1:
timesYouWon = timesYouWon + 1;
When the loop ends, you need to use a decision making to determine who the final winner
is:
If tiimesIWon == timesYouWon
TheWinner = “TIE”
Else if ….
TheWinner = “YOU”
Else
TheWinner = “ME”
Display the final winner. The values can be “YOU”, “ME”, and “TIE”.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps