Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92718376

Have any Question?


Related Questions in Computer Engineering

Question you are a software engineer working at a large

Question You are a software engineer working at a large publicly-traded corporation, where a colleague invents a new kind of compiler. Your managers see it as a huge potential cash cow. How would you respond in a way tha ...

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

Referring to the slides from text book chapter 5 there are

Referring to the slides from text book, Chapter 5, there are two versions of Fibonacci number calculators: BinaryFib(n) and LinearFibonacci(n). The first algorithm has exponential time complexity, while the second one is ...

One of the basic motivations behind the minimum spanning

One of the basic motivations behind the Minimum Spanning Tree Problem is the goal of designing a spanning network for a set of nodes with minimum  total  cost. Here we explore another type of objective: designing a spann ...

How does understanding various microsoft office

How does understanding various Microsoft Office applications enhance productivity in education, the workplace, and at home.

Give a recursive algorithm that generates a similar series

Give a recursive algorithm that generates a similar series of coins for changing n cents. Don't use dynamic programming for this problem.

Question suppose that a table has 9 columns it is known

Question : Suppose that a table has 9 columns. It is known that we only need to provide values for 4 columns explicitly to insert a new row successfully. Assume that there are n columns with default values and there are ...

Question 1two variables have a negative non-linear

Question 1 Two variables have a negative non-linear correlation. Does the dependent variable increase or decrease as the independent variable increases? A)Dependent variable would remain the same B)Dependent variable inc ...

A population has a mean72 and a standard deviation sigma28

A population has a mean=72 and a standard deviation σ=28. Find the mean and standard deviation of a sampling distribution of sample means with sample size n=49.

Biodiversity refers to the variety of living organisms

Biodiversity refers to the variety of living organisms found within an ecosystem. In your description, evaluate the role of humans in the current biodiversity loss situation and increased species extinction rate. In addi ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As