ENGR 160 Exam 2

advertisement
ENGR 160 Exam 2
Fall ‘10
Name _____________________________________________
ENGR. PROB.:
_____ /50
PROGRAMMING _____/ 50
TOTAL:
_____/100
DIRECTIONS: This exam is CLOSED BOOK. The reference sheet plus one extra page of notes (both sides of
one 8.5” by 11” paper) may be consulted during the exam.
Engineering Problems (Express all answers in the proper number of significant digits)
1.
(30%) A 15.0 meter beam has a mass of 11.5 kg/m and is supported by a pin at point A. The beam has a cable
that is connected to it at point B. The cable is perpendicular to the beam. Also, an object is hung from point C
which has a mass of 210.0 kg.
a.
Draw a complete free-body diagram.
b.
Write the equilibrium equations.
c.
Solve for the reaction forces at point A and B (expressed forces as magnitude and direction).
ENGR 160 Exam 2 Fall ’10
2.
Name _____________________________________________
(10%) Four forces are applied at a point in a body as shown in the figure below. The forces are all listed in
pounds-force (lbf). Assume the given force and angle values are all known to two significant digits.
Determine the magnitude and the direction of the resultant force, R, of the four forces (express the magnitude in lb f).
ENGR 160 Exam 2 Fall ’10
3.
Name _____________________________________________
(10%) Approximations of missile velocities were recorded over a predetermined fixed distance and are shown
in the table below. Each value is rounded to the nearest 10 m/s. You must SHOW YOUR WORK on all of the
problems below.
Velocities,
V, m/s
980
930
850
970
1000
960
880
1020
900
940
950
870
970
1030
970
1010
960
940
950
600
V = 18 680
V2 = 17 608 600
a)
Find the mean velocity.
b) Find the standard deviation of the velocities.
c)
Determine the number of the velocities (and list their values) that vary by more than one standard
deviation from the mean.
ENGR 160 Exam 2 Fall ’10
Name _____________________________________________
Programming
4.
(15%) Write ONLY a Function subprogram that receives two real, one-dimensional arrays (representing two
vectors) and an integer value, n (representing the number of elements in each array), n will never be more than
100. The Function will compute the dot product of these two arrays.
The following equation describes the dot product of two vectors:
n
Dotproduct   (Vector1( i )) x (Vector2( i ))
i 1
For example if n = 3 and the first array contains these three numbers: 1.0, 5.0, 6.5 and the second array contains
these three numbers: 2.3, 6.1, 3.2, the dot product of these vectors would be: (1.0)(2.3) + (5.0)(6.1) + (6.5)(3.2)
= 53.6
The computed dot product value will be returned to the main program.
ENGR 160 Exam 2 Fall ’10
5.
Name _____________________________________________
(15%) A main program exists which will send a real one-dimensional array (dimensioned to have up to 500
entries in the main program) to a subprogram. The array contains stress measurements for various materials.
Since these values should be positive, a negative value in the array is used to indicate the end of the data.
Write a complete Subprogram (ONLY) which can be used to calculate the mean of the positive data values and
the number (an integer) of positive data values. The subprogram must pass back both the mean value and the
count of positive data values to the main program (no Write statements in the subprogram are needed).
.
ENGR 160 Exam 2 Fall ’10
6.
Name _____________________________________________
(20%) You have created an input file which contains a list of your ten favorite stocks from the New York Stock
Exchange. The file, named: Stocks.txt, contains the stock name, its current selling price and its 52-week low
price (these three items are on each line). The input file has “ “ around the words and commas separating each
item on a line such as: "Maytag Corp (MYG)", 17.40, 15.30
Write a VBA program which will:
a. Read the data into three, one-dimensional arrays (NAME(), PRICE() and LOW()).
b. There will always be ten stocks listed in the data file.
c. Calculate the percentage gain of the current selling price as compared to the 52-week low (this
could be a positive or negative gain) and assign this to another one-dimensional array (GAIN()).
d. Output to a file, named: StocksOut.txt, the following headings with the appropriate data under
each heading (example output shown).
Stock Name
Selling Price
52-Week Low
Maytag Corp (MYG)
$17.40
$15.30
. example output shown above.
Percent Gain
13.73%
Download