Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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):

image text in transcribed

image text in transcribed

Scissors beats paper % Scissors beats paper %

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions

Question

Does it avoid use of underlining?

Answered: 1 week ago