Write a sub procedure that plays the game ro-sham-bo

Assignment Help Computer Engineering
Reference no: EM131890029

Homework: Programming Structures

PROBLEMS -

Open a blank Excel workbook and save it as a MACRO-ENABLED file. Your workbook must contain only two worksheets named "Prob1" and "Prob2", respectively. Open the Visual Basic Editor (VBE) and insert a new module into the Project Explorer. You must write (NOT record) all your sub procedures inside this module.

Problem 1 -

a) Add a module (i.e., Module1) in the Project Explorer and write (do NOT record) all the code for this problem inside this module. Show your results in a worksheet labeled "Prob1".

b) Write a sub procedure that allows a user to create a list of individuals displaying their last name, first name and age, as well as the length of each of these data strings. Your sub procedure must do the following:

- Prompt the user for the total number of people to be entered in the spreadsheet via an input box. Assume that the user always enters a valid integer number in this step. The sub procedure must terminate execution if the "Cancel" button of this input box is pressed.

- Given the total number of entries provided, prompt the user to enter the age, first name, and last name for each person via another input box. This input box must display a default value prompting the user to enter each data string in the right order and separated by a comma. For example, the user must enter "45, Jenny, Jones" for the first person, "28, Mike, Pedersen" for the second, and so on. Each entry constitutes a record. Your program must use a repetition structure and, based on the number of records to be entered, present the same input box to meet this requirement. The sub procedure must NOT allow the user to terminate execution if the "Cancel" button of this input box is pressed.

- Your program must ignore any blank spaces entered before and/or after each string and only report the length of the actual string. For example, if a user enters "¢¢¢23¢¢,Lane¢¢¢¢¢¢¢¢¢¢,¢¢¢¢¢¢¢¢Louise", your program should report string lengths of 6, 4 and 2 for the last name, first name and age, respectively. The special character "¢" indicates a blank space in the example.

- Each record entered by the user must be separated into its individual components and displayed on the spreadsheet "Prob2" in separate cells, as shown in Figure 2. The first record entered by the user should be printed on row 3. Column B should display last names, column C should display the length of last names, column D should display first names, column E should display the length of first names, column F should display ages, and column G should display the length of ages. The columns headings can be entered by hand in the spreadsheet.

- You must use a variable of type Range in combination with the Offset property to enter each record in a row and each entry on a column.

- The interior color of every other row should be changed to improve the readability of individual records.

- Columns must automatically adjust their width to the length of the strings entered.

- The total number of records displayed on the spreadsheet should match the number of entries specified by the user.

c) Assign the sub procedure to a shape button.

2137_fiugre.png

Problem 2 -

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 - Paper beats Rock

The same selection results in a tie.

Your sub procedure must do the following:

- The sub procedure should be named Ro_Sham_Bo.

- 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.

- Generate another random value between 1 and 3 for the computer's choice with the same rules as for the player's choice.

- 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." 

- Place one second delays between displaying each of the three items listed above (image, explanation, and result).

Assign the sub procedure Ro_Sham_Bo to a rectangular shape button. The caption of the rectangular shape button should read "Ro - Sham - Bo!".

1963_figure1.png

Attachment:- Assignment Files.rar

Reference no: EM131890029

Questions Cloud

Determine and describe the four managerial functions : Identify and describe the four managerial functions that can be applied in Starbucks business in Saudi Arabia.
What is the hhi in decimal form : Imagine there are 4 hospitals in a market and each has an equal market share of 25%. What is the HHI in decimal form?
Explain how a service is configured : csc3412 - differences between different Unix distributions-the question explicitly states discuss the Linux version only - The report with examples
Compute point price elasticity of demand for bearing grease : Calculate the point price elasticity of demand for bearing grease. Calculate the optimal price for bearing grease if marginal cost is $4.60 per unit.
Write a sub procedure that plays the game ro-sham-bo : IE 212 Homework: Programming Structures. Write a sub procedure that plays game Ro-Sham-Bo (a.k.a., Rock, Paper, Scissors) for player and computer opponent
Model of aggregate demand and aggregate supply : Explain Home Depot's economic fluctuations and how shifts in either aggregate demand or aggregate supply can cause booms and recessions
What is your rate of return on this position : What is your rate of return on this position, if you close it out at $32 per share after one year?
Resulting change in equilibrium price and quantity : When demand changes, how does the elasticity of supply effect the resulting change in equilibrium price and quantity? Why so?
Discuss the purpose of each states reform : Describe a minimum of three specific examples of similarities and differences in healthcare reform policies in the two states.

Reviews

len1890029

3/7/2018 12:02:23 AM

DELIVERABLE - Submit a single Excel file via Canvas. Before submitting your solution file, make sure that the sample data provided for each problem is in the format it was before you tested your sub procedures. Solutions for each individual problem should be prepared in separate worksheets. Submit all your code in a .pdf file. 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.)

len1890029

3/7/2018 12:02:18 AM

Additional requirements: Make sure your program does not experience any flickering when processing the input data or producing results. Make sure to follow programming practices. In particular, pay close attention to the following: Explicitly declaring all variables; Properly indenting code so that it is more readable; Adding comments to your code. Upload your two homework files, the .xlsm file and the .pdf file, to Canvas before the due date specified on Canvas. Late homework will not be accepted.

Write a Review

Computer Engineering Questions & Answers

  Recognize 3 to 5 technology or telecom standards

identify 3 to 5 technology or telecom standards organizations and the role they play in the industry. choose one

  Discuss the simplicity of the dtd compared xml schema

Discuss the simplicity of the DTD compared to that of XML Schema. Has trade-off gone too far towards complexity in trying to overcome the limitations of the DTD.

  What is internet of things and what is your opinion of it

What is the "Internet of Things"? What is your opinion of it? Is it good or bad? Detail your reasons why you developed this opinion. However ensure your answers are well-founded, and written in an educated manner.

  Explain the distinctions between time and arrangements

Explain the distinctions between time and arrangements, fixed-price, and value-added outsourcing contracts. What are the pros and cons of each?

  Some it department policies are designed to prevent

some it department policies are designed to prevent behaviors by it staff. while some depend upon the employee

  How the carlson san approach would be implemented

Assess how the Carlson SAN approach would be implemented in today's environment. Assess how cloud computing could be used by Carlson instead of a SAN.

  What problems if any do you run into

DATS 6103: Introduction to Data Mining Problems. User-based collaborative filtering approach. Use Euclidean, Manhattan, correlational, and cosine similarity distance measures. What problems (if any) do you run into

  How to designed to implement the date in a program

The class Date was built to implement the date in a program, but the method setDate and the constructor with parameters do not check whether the date is valid before storing the date in the data members.

  What would be the typical improvements

What other databases (Oracle, DB2, etc) would be known to benefit a clerical/job placement (staffing agency) organization using databases.

  Declaring and intializing the array

Describe an ArrayList named taxRates of the five elements of type Double and initialize the elements (starting with the first) to the values 0.10 , 0.15 , 0.21 , 0.28 , 0.31, respectively.

  What are some drawbacks of databases

What are some drawbacks of databases.Can you mix summarized data with non summarized data.

  Requirements for an automated home bottle

Flexible design enables a quick change from one bottle to another and easy adjustment of the cutting locations according to the size and shape of the container

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd