Question
VBA ONLY!!!! Download S2018-Exam 1_part _2.xlsm and use the supplied worksheet to complete the problem below. Create a button on the worksheet to run your
VBA ONLY!!!!
Download S2018-Exam 1_part _2.xlsm and use the supplied worksheet to complete the problem below. Create a button on the worksheet to run your program. Pseudocode or a Flowchart is not required, but could help. COMMENT your code, it wont count directly, but may help the graders grant you partial credit if they understand what you are doing.
You should all be very familiar with the game of Rock, Paper, Scissors, (also known as Rochambeau or Roshambo). If youve been living under the aforementioned rock, Ill layout the rules here:
In other words, Rock beats Scissors, Scissors beats Paper, and Paper beats Rock. If both players throw the same shape, the round is a tie.
Write a subroutine that will play rounds of Roshambo between the program and a player. Have the program pick a shape (at random), and then ask the player to choose one (use an Inputbox to ask for input).
Output the computers and the players choices on the indicated columns on the worksheet. Write a *separate* function that will determine the result of the round (program wins, player wins or tie) given the programs choice and the players choice. Keep playing until either the computer or the player gets 5 wins, then indicate (via Msgbox) who won (optionally indicate what the score was).
Hints:
You can store the programs and players throws (choices) as text (strings) or integers, either is acceptable.
You can output the results as text or integers as well, as long as you provide a legend (i.e. 0 = rock, 1 = scissors, 2 = paper)
Sample input and output might look like (this is just an example):
Scissors beats paper % Scissors beats paper %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