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

Review the website airmail service from the smithsonian

Review the website Airmail Service from the Smithsonian National Postal Museum that is dedicated to the history of the U.S. Air Mail Service. Go to the Airmail in America link and explore the additional tabs along the le ...

Read the article frank whittle and the race for the jet

Read the article Frank Whittle and the Race for the Jet from "Historynet" describing the historical influences of Sir Frank Whittle and his early work contributions to jet engine technologies. Prepare a presentation high ...

Overviewnow that we have had an introduction to the context

Overview Now that we have had an introduction to the context of Jesus' life and an overview of the Biblical gospels, we are now ready to take a look at the earliest gospel written about Jesus - the Gospel of Mark. In thi ...

Fitness projectstudents will design and implement a six

Fitness Project Students will design and implement a six week long fitness program for a family member, friend or co-worker. The fitness program will be based on concepts discussed in class. Students will provide justifi ...

Read grand canyon collision - the greatest commercial air

Read Grand Canyon Collision - The greatest commercial air tragedy of its day! from doney, which details the circumstances surrounding one of the most prolific aircraft accidents of all time-the June 1956 mid-air collisio ...

Qestion anti-trustprior to completing the assignment

Question: Anti-Trust Prior to completing the assignment, review Chapter 4 of your course text. You are a manager with 5 years of experience and need to write a report for senior management on how your firm can avoid the ...

Question how has the patient and affordable care act of

Question: How has the Patient and Affordable Care Act of 2010 (the "Health Care Reform Act") reshaped financial arrangements between hospitals, physicians, and other providers with Medicare making a single payment for al ...

Plate tectonicsthe learning objectives for chapter 2 and

Plate Tectonics The Learning Objectives for Chapter 2 and this web quest is to learn about and become familiar with: Plate Boundary Types Plate Boundary Interactions Plate Tectonic Map of the World Past Plate Movement an ...

Question critical case for billing amp codingcomplete the

Question: Critical Case for Billing & Coding Complete the Critical Case for Billing & Coding simulation within the LearnScape platform. You will need to create a single Microsoft Word file and save it to your computer. A ...

Review the cba provided in the resources section between

Review the CBA provided in the resources section between the Trustees of Columbia University and Local 2110 International Union of Technical, Office, and Professional Workers. Describe how this is similar to a "contract" ...

  • 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