Write a sub procedure named periodpendulum

Assignment Help Other Subject
Reference no: EM131884094

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.

Reference no: EM131884094

Questions Cloud

Analyze big data and its relation to volume : Analyze Big Data and its relation to Volume, Velocity and Variety. Assess the importance of Big Data within government organizations.
Should the company buy a call on gold or a put on gold : Should the company buy a call on gold or a put on gold? Explain. Draw the payoff diagram depicting the information.
What california do to remain competitive with other states : Watch a YouTube video Tech or Bust Maintaining California's Edge in the Workforce. What can California do to remain competitive with other states and countries?
Which bank would experience surge in demand for loans : Which bank would experience a surge in demand for loans? Which bank would receive a surge in deposits?
Write a sub procedure named periodpendulum : IE 212 Homework - String Manipulation, Input Boxes and Message Boxes. Write a sub procedure named periodPendulum
Would you describe valve corporation as a flat organization : Would you describe Valve Corporation as a flat organization? Why? Does such a structure seem to be effective for Valve?
What will happen to these bonds duration measure : What will happen to these bonds duration measure under these two situations:
Applied to the project cash flows : You are viewing a graph that plots the NPVs of a project to various discount rates that could be applied to the project's cash flows.
Analyze at least four claims that might commonly be made : Analyze at least four claims that might commonly be made that display some of the errors in reasoning covered in this module's readings.

Reviews

len1884094

3/1/2018 1:53:42 AM

IMPORTANT NOTE: To receive full credit in this problem, you MUST use variables to perform the necessary string manipulations. You are NOT allowed to use formulas or to assign strings to cells in the spreadsheet to manipulate them. 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.

len1884094

3/1/2018 1:53:36 AM

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

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

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