Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in excel vba Problem 2 25 ptal Write a sub procedure that plays the game Ro-Sham-Bo (a k.a., Rock, Paper, Scissors) for a player and

in excel vba

image text in transcribedimage text in transcribed

Problem 2 25 ptal Write a sub procedure that plays the game Ro-Sham-Bo (a k.a., Rock, Paper, Scissors) for a player and a computer opponent. The player selects one of the options listed in an input box, then the computer randomly selects an option as well. The winner of the game is determined as follows: Rock beats Scissors Scissors beats Paper beats Rock The same selection results in a tie. Your sub procedure must do the following: a) The sub procedure should be named Bensham Bo b) Prompt the player to enter a selection with an input box. Provide instructions to use the integers one, two, and three to represent the selection. Assume the player enters a valid choice (i.e-, you do not need to validate the input), but allow the sub procedure to end if the cancel button is pressed. c Generate another random value between 1 and 3 for the computer's choice with the same rules as for the player's choice. d) Display the player and the computer choices with the appropriate image in the spreadsheet. Also, display a label explaining the outcome (e.g., Rock Smashes Scissors Finally, if the player wins, display "You win!", if the computer wins, display "You lose! and if the result is a tie display "No winner.' e) Place onc sepood delays between displaying each of the thee items listed above (image, explanation, and result). Assign the sub procedure Ro sham. to a rectangular shape button. The caption of the rectangular shape button should read "Ro Sham Bo". NOTE: You are at liberty to design the interface of your sub procedure using the shapes available in the power point file "HW7 Shapes". Figure 1 is an example of an interface for this problem. (Bonus: After a player selects an option, try to provide simple animation" to mimic the way this game is played in person.)

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions

Question

=+development and make the product, should you go ahead and do so?

Answered: 1 week ago

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago