Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Homework Help/Study Tips Expert

Homework - String Manipulation, Input Boxes and Message Boxes

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.

1. Problem 1 (see Figure 1).

An Internet Protocol (IP) address is a numerical label assigned to each device in a computer network (e.g., computer, printer, etc.) To simplify their interpretation, IP addresses are represented as four decimal numbers separated by periods (e.g., 131.65.10.18). This representation is known as dotted decimal notation. The number of decimal numbers of an IP address that are used for the network identification (ID) number and the host ID number depend on which class it belongs to. For example, Class B IP addresses use the first two decimal numbers for the network ID and the remaining two decimal numbers for the host ID. Thus, in the Class B IP address 168.212.226.204, "168.212" identifies the network ID and "226.204" identifies the host ID.

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 the worksheet labeled "Prob1."

b) Write a sub procedure named ipAddress that takes a user-provided Class B IP address in dotted decimal notation from cell C6 and does the following:

Displays the network ID portion of the IP address in cell C8. For this problem, assume that the first decimal number of the IP address is restricted to values from 128 to 191 and that the second decimal number can assume any value between 1 and 255.

Display the host ID portion of the IP address in cell C9. For this problem, assume that the third decimal number of the IP address can assume any value between 0 and 255 and the fourth decimal number is restricted to values from 1 to 255.

Display the individual decimal numbers of the IP address as follows:

  • First decimal number → Cell C10
  • Second decimal number → Cell C11
  • Third decimal number → Cell C12
  • Fourth decimal number → Cell C13

Cells B8, B9, B10, B11, B12 and B13 should display the labels "Network ID:", "Host ID:", "1st decimal:", "2nd decimal:", "3rd decimal:" and "4th decimal:", respectively.

Select cell A1 once sub procedure terminates execution.

Assign the sub procedure to a shape button labeled "IP Address Information".

c) Write a sub procedure named clearIPData to clear the contents of range C8:C13. Assign the sub procedure to a shape button labeled "Clear IP Address Data".

1073_figure.png

2. Problem 2 (see Figure 2).

A simple pendulum consists of a weight suspended on a string or wire. If the pendulum weight is pulled to a relatively small angle from the vertical and let go, it will swing back and forth at a regular period (T) and frequency (f). The period of the motion of a pendulum (i.e., how long it takes the pendulum to swing back-and-forth) is measured in seconds. The frequency of a pendulum (i.e., how many back-and-forth swings there are in a second) is measured in hertz. The period T is the reciprocal of the frequency and vice versa (i.e., T = 1/f and f = 1/T). The formula to calculate the period of a pendulum as a function of the length of the wire and the acceleration due to gravity is:

T = 2 * π * √(L/g)

Where:

L = Length of the wire (in meters).

g = Acceleration due to gravity (∼9.8 m/s2)

a) Add a module (i.e., Module2) 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 "Prob2."

b) Write a sub procedure named periodPendulum that does the following:

Prompts the user for the length of the wire (L) in meters via an input box. Assume that the user always enters a valid value for L. Therefore, you do NOT need to implement any validation procedure for the input in this problem.

Calculates the period with equation (1) shown above.

Displays the period (T) and frequency (f) in separate lines within a message box.

Displays the values of L, T, and f in the spreadsheet. You are at liberty to decide where to display and how to format the results. Minimal work will get minimal grading.

Clears the values of L, T, and f from the spreadsheet every time the sub procedure is executed at the beginning of the sub procudure.

Selects cell A1 once the sub procedure terminates execution.

c) Assign the sub procedure to a shape button labeled "START".

2185_figure1.png

Requirements for BOTH problems:

Assign the input values entered by the user (either via an Input Box or entered into the spreadsheet) to variables of the appropriate type.

Make sure your program does not experience any flickering when processing the input data or producing results.

Make sure to follow good programming practices. In particular, pay close attention to the following:

  • Explicitly declaring all variables;
  • Properly indenting code so that it is more readable; and
  • Adding comments to your code.

Homework Help/Study Tips, Others

  • Category:- Homework Help/Study Tips
  • Reference No.:- M92712441
  • Price:- $70

Guranteed 36 Hours Delivery, In Price:- $70

Have any Question?


Related Questions in Homework Help/Study Tips

Part 1make an online inquiry and search the internet for

Part 1 Make an online inquiry and search the Internet for your favorite unmanned system. Prepare a short presentation (any type - Pecha Kucha is not necessary) about the essential technical characteristics, possible miss ...

Right to privacy assignmentcertain freedoms such as civil

Right to Privacy Assignment Certain freedoms such as civil liberties and civil rights are concepts highly revered by Americans; however, there are times when these two concepts conflict in the name of safety and national ...

Question 1 and 2 must be answered on separate pages with

Question 1 and 2 must be answered on separate pages with separate references. Question 1 Review "Doing the Right Thing" in Chapter 5. Governmental Planning Takes Diverse Forms. A partial list of large-scale governmental ...

Watch the video titled the exclusionary rule for dummies -

Watch the video titled, "The Exclusionary Rule for Dummies - Mapp v Ohio and the 4th Amendment" (11 min 12 s). You can also view the video. Next, examine two (2) exceptions to the rule. Provide your opinion as to whether ...

Question observe nurses in a care delivery setting identify

Question: Observe nurses in a care delivery setting. Identify a recurring conflict with the potential to negatively impact patient care. Decide if delegation was an issue in the conflict. This should be from your practic ...

Question professional format and stylehow you do anything

Question: "Professional Format and Style" How you do anything is how you do everything. - T. Harv Eker (from Secrets of the Millionaire Mind) This course is a mixture of learning a new format (business style) and adaptin ...

Question please watch the videoshelping the faceblind see -

Question: Please watch the videos: Helping the Faceblind See - Prosopagnosia (also known as face blindness) is a condition that refers to the inability to recognize a face that you've seen before and should be able to re ...

This week you will be sharing your personal brand and a

This week you will be sharing your personal brand and a video recording of your elevator pitch! Share your Personal Branding Statement first. This should not be any more than 1-2 sentences. Next, share who you are "in th ...

The purpose of this assignment is to broaden your

The purpose of this assignment is to broaden your understanding of a community, develop analytical skills regarding communities in relation to specific populations and their needs, and to better plan and develop interven ...

Discussion 1 self-determinationin the christ amp diwan 2008

Discussion 1: Self-Determination In the Christ & Diwan (2008) article, the authors list seven domains that social workers should address in order to fully assess an older client's needs. Each domain is considered equally ...

  • 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