Nothing Special   »   [go: up one dir, main page]

Introduction To Programming Using Visual Basic 2012 9Th Edition Schneider Test Bank Full Chapter PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 37

Introduction to Programming Using

Visual Basic 2012 9th Edition Schneider


Test Bank
Visit to download the full and correct content document: https://testbankdeal.com/dow
nload/introduction-to-programming-using-visual-basic-2012-9th-edition-schneider-test
-bank/
Chapter 6 Repetition

Section 6.1 Do Loops

1. What is wrong with the following Do loop?


Dim index As Integer = 1
Do While index <> 9
lstBox.Items.Add("Hello")
index += 1
Loop
(A) The test variable should not be changed inside a Do loop.
(B) The test condition will never be true.
(C) This is an infinite loop.
(D) Nothing
D

2. What numbers will be displayed in the list box when the button is clicked?
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim num as Double = 10
Do While num > 1
lstBox.Items.Add(num)
num = num - 3
Loop
End Sub

(A) 10, 7, and 4


(B) 10, 7, 4, and 1
(C) 10, 7, 4, 1, and -2
(D) No output
A

3. Which While statement is equivalent to Until num < 100?


(A) While num <= 100
(B) While num > 100
(C) While num >= 100
(D) There is no equivalent While statement.
C
4. What is wrong with the following Do loop?
Dim index As Integer = 1
Do While index <> 10
lstBox.Items.Add("Hello")
index += 2
Loop
(A) It should have been written as a Do Until loop.
(B) It is an infinite loop.
(C) The test variable should not be changed within the loop itself.
(D) Nothing
B

5. In analyzing the solution to a program, you conclude that you want to construct a loop so
that the loop terminates either when (a < 12) or when (b = 16). Using a Do loop, the test
condition should be
(A) Do While (a > 12) Or (b <> 16)
(B) Do While (a >= 12) Or (b <> 16)
(C) Do While (a < 12) Or (b <> 16)
(D) Do While (a >= 12) And (b <> 16)
(E) Do While (a < 12) And (b = 16)
D

6. When Visual Basic executes a Do While loop it first checks the truth value of the
_________.
(A) pass
(B) loop
(C) condition
(D) statement
C

7. If the loop is to be executed at least once, the condition should be checked at the
__________.
(A) top of the loop
(B) middle of the loop
(C) bottom of the loop
(D) Nothing should be checked.
C

8. A Do While loop checks the While condition before executing the statements in the loop.
(T/F)
T

9. If the While condition in a Do While loop is false the first time it is encountered, the
statements in the loop are still executed once. (T/F)
F
10. The following statement is valid. (T/F)
Do While x <> 0
T

11. The following two sets of code produce the same output. (T/F)
Dim num As Integer = 1 Dim num As Integer = 1
Do While num <=5 Do
lstBox.Items.Add("Hello") lstBox.Items.Add("Hello")
num += 1 num += 1
Loop Loop Until (num > 5)
T

12. A loop written using the structure Do While...Loop can usually be rewritten using the
structure Do...Loop Until. (T/F)
T

13. A variable declared inside a Do loop cannot be referred to outside of the loop. (T/F)
T

14. Assume that i and last are Integer variables. Describe precisely the output produced by the
following segment for the inputs 4 and –2.
Dim last, i As Integer
last = CInt(InputBox("Enter terminating value:"))
i = 0
Do While (i <= last)
lstBox.Items.Add(i)
i += 1
Loop
(Input 4): 0 1 2 3 4
(Input –2): No output

15. The following is an infinite loop. Rearrange the statements so that the loop will terminate as
intended.
x = 0
Do
lstBox.Items.Add(x)
Loop Until x > 13
x += 2
Move the last statement one line up, before the Loop Until statement
16. What is wrong with the following simple password program where today's password is
"intrepid"?
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim password As String
password = InputBox("Enter today's password:")
Do
lstBox.Items.Add("Incorrect")
password = InputBox("Enter today's password:")
Loop Until password = "intrepid"
lstBox.Items.Add("Password Correct. You may continue.")
End Sub
(A) There is no way to re-enter a failed password.
(B) The Loop Until condition should be passWord <> "intrepid".
(C) It will display "Incorrect." even if the first response is "intrepid".
(D) Nothing
C

17. How many times will HI be displayed when the following lines are executed?
Dim c As Integer = 12
Do
lstBox.Items.Add("HI")
c += 3
Loop Until (c >= 30)
(A) 5
(B) 9
(C) 6
(D) 4
(E) 10
C

18. In the following code segment, what type of variable is counter?


Dim temp, counter, check As Integer
Do
temp = CInt(InputBox("Enter a number."))
counter += temp
If counter = 10 Then
check = 0
End If
Loop Until (check = 0)
(A) counter
(B) accumulator
(C) sentinel
(D) loop control variable
B
19. What numbers will be displayed in the list box by the following code when the button is
clicked?
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim num As Integer = 7
Do
num += 1
lstBox.Items.Add(num)
Loop Until (num > 6)
lstBox.Items.Add(num)
End Sub
(A) 7
(B) 8
(C) 7 and 8
(D) 8 and 8
D

20. __________ calculate the number of elements in lists.


(A) Sentinels
(B) Counter variables
(C) Accumulators
(D) Nested loops
B

21. _________ calculate the sums of numerical values in lists.


(A) Sentinels
(B) Counter variables
(C) Accumulator variables
(D) Nested loops
C

22. The following are equivalent While and Until statements. (T/F)
While (num > 2) And (num < 5)
Until (num <= 2) Or (num >= 5)
T

23. A Do…Loop Until block is always executed at least once. (T/F)


T

24. A counter variable is normally incremented or decremented by 1. (T/F)


T
25. The following program uses a counter variable to force the loop to end. (T/F)
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim r As Double = 1
Dim t As Double = 0
Do While (t < 5000)
t = 2 * t + r
r += 1
lstBox.Items.Add(t)
Loop
End Sub
F

Section 6.2 For…Next Loops

1. When the number of repetitions needed for a set of instructions is known before they are
executed in a program, the best repetition structure to use is a(n)
(A) Do While...Loop structure.
(B) Do...Loop Until structure.
(C) For...Next loop.
(D) If blocks.
C

2. What is one drawback in using non-integer Step sizes?


(A) Round-off errors may cause unpredictable results.
(B) Decimal Step sizes are invalid in Visual Basic.
(C) A decimal Step size is never needed.
(D) Decimal Step sizes usually produce infinite loops.
A

3. When the odd numbers are added successively, any finite sum will be a perfect square (e.g.,
1 + 3 + 5 = 9 and 9 = 3^2). What change must be made in the following program to correctly
demonstrate this fact for the first few odd numbers?
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim oddNumber As Integer
Dim sum As Integer = 0
For i As Integer = 1 To 9 Step 2 'Generate first few odd numbers
oddNumber = i
For j As Integer = 1 To oddNumber Step 2 'Add odd numbers
sum += j
Next
lstBox.Items.Add(sum & " is a perfect square.")
Next
End Sub
(A) Change the Step size to 1 in the first For statement.
(B) Move oddNumber = i inside the second For loop.
(C) Reset sum to zero immediately before the second Next statement.
(D) Reset sum to zero immediately before the first Next statement.
C
4. What does the following program do with a person's name?
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim name, test As String
Dim n As String = ""
name = InputBox("Enter your first name:")
For i As Integer = 0 To (name.Length - 1) Step 2
test = name.Substring(i, 1)
n = test & n
Next
txtBox.Text = n
End Sub
It displays the name
(A) in reverse order.
(B) in reverse order and skips every other letter.
(C) as it was entered.
(D) as it was entered, but skips every other letter.
B

5. Suppose the days of the year are numbered from 1 to 365 and January 1 falls on a Tuesday
as it did in 2013. What is the correct For statement to use if you want only the numbers for
the Fridays in 2013?
(A) For i As Integer = 3 to 365 Step 7
(B) For i As Integer = 1 to 365 Step 3
(C) For i As Integer = 365 To 1 Step -7
(D) For i As Integer = 3 To 365 Step 6
A

6. Given the following partial program, how many times will the statement
lstBox.Items.Add(j + k + m) be executed?
For j As Integer = 1 To 4
For k As Integer = 1 To 3
For m As Integer = 2 To 10 Step 3
lstBox.Items.Add(j + k + m)
Next
Next
Next
(A) 24
(B) 60
(C) 36
(D) 10
(E) None of the above
C
7. Which of the following program segments will sum the eight numbers input by the user?

(A)For k As Integer = 1 To 8
s = CDbl(InputBox("Enter a number.")
s += k
Next
(B) For k As Integer = 1 To 8
a = CDbl(InputBox("Enter a number.")
s += 1
Next
(C) For k As Integer = 1 To 8
a = CDbl(InputBox("Enter a number.")
a += s
Next
(D) For k As Integer = 1 To 8
a = CDbl(InputBox("Enter a number.")
s += a
Next
D

8. What will be displayed by the following program when the button is clicked?
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim a As String, n, c As Integer
a = "HIGHBACK"
n = CInt(Int(a.Length / 2))
c = 0
For k As Integer = 0 To n – 1
If a.Substring(k, 1) > a.Substring(7 – k, 1) Then
c += 1
End If
Next
txtBox.Text = CStr(c)
End Sub

(A) 1
(B) 2
(C) 3
(D) 4
(E) 5
C

9. In a For statement of the form shown below, what is the default step value when the "Step c"
clause is omitted?
For i As Integer = a To b Step c
(A) the same as a
(B) the same as b
(C) 0
(D) 1
D
10. What will be displayed when the following lines are executed?
txtBox.Clear()
For k As Integer = 1 To 3
txtBox.Text &= "ABCD".Substring(4 – k, 1)
Next

(A) ABC
(B) CBA
(C) DBA
(D) DCBA
(E) DCB
E

11. Which loop computes the sum of 1/2 + 2/3 + 3/4 + 4/5 + … + 99/100?
(A) For n As Integer = 1 To 99
s += n / (1 + n)
Next
(B) For q As Integer = 100 To 1
s += (q + 1) /q
Next
(C) For d As Integer = 2 To 99
s = 1 / d + d / (d + 1)
Next
(D) For x As Integer = 1 To 100
s += 1 / (x + 1)
Next
A

12. How many times will PETE be displayed when the following lines are executed?
For c As Integer = 15 to -4 Step -6
lstBox.Items.Add("PETE")
Next
(A) 1
(B) 2
(C) 3
(D) 4
D
13. What will be displayed by the following program when the button is clicked?
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim s As Double
s = 0
For k As Integer = 1 To 5
If k / 2 = Int(k / 2) Then
s += k
End If
Next
txtBox.Text = CStr(s)
End Sub

(A) 12
(B) 9
(C) 15
(D) 6
D

14. How many lines of output are produced by the following program segment?
For i As Integer = 1 To 3
For j As Integer = 1 To 3
For k As Integer = i to j
lstBox.Items.Add("Programming is fun.")
Next
Next
Next
(A) 8
(B) 9
(C) 10
(D) 11
C

15. Assuming the following statement, what is the For...Next loop's counter variable?
For yr As Integer = 1 To 5
(A) 1
(B) 5
(C) To
(D) yr
D
16. What is the value of j after the end of the following code segment?
For j As Integer = 1 to 23
lstBox.Items.Add("The counter value is " & j)
Next

(A) 22
(B) 23
(C) 24
(D) j no longer exists
D

17. A For...Next loop with a positive step value continues to execute until what condition is
met?
(A) The counter variable is greater than the terminating value.
(B) The counter variable is equal to or greater than the terminating value.
(C) The counter variable is less than the terminating value.
(D) The counter variable is less than or equal to the terminating value.
A

18. Which of the following loops will always be executed at least once when it is encountered?
(A) a For...Next loop
(B) a Do loop having posttest form
(C) a Do loop having pretest form
(D) none of the above.
B

19. Which of the following are valid for an initial or terminating value of a Fir...Next loop?
(A) a numeric literal
(B) info.Length, where info is a string variable
(C) a numeric expression
(D) All of the above
D

20. What is the data type of the variable num if Option Infer is set to On and the statement
Dim num = 7.0 is executed?
(A) Integer
(B) Boolean
(C) Double
(D) String
C

21. The value of the counter variable should not be altered within the body of a For…Next loop.
(T/F)
T
22. The body of a For...Next loop in Visual Basic will always be executed once no matter what
the initial and terminating values are. (T/F)
F

23. If the terminating value of a For...Next loop is less than the initial value, then the body of the
loop is never executed. (T/F)
F

24. If one For...Next loop begins inside another For...Next loop, it must also end within this
loop. (T/F)
T

25. The value of the counter variable in a For...Next loop need not be a whole number. (T/F)
T

26. One must always have a Next statement paired with a For statement. (T/F)
T

27. If the initial value is greater than the terminating value in a For...Next loop, the statements
within are still executed one time. (T/F)
F

28. When one For...Next loop is contained within another, the name of the counter variable for
each For...Next loop may be the same. (T/F)
F

29. A For...Next loop cannot be nested inside a Do loop. (T/F)


F

30. The following code segment is valid. (T/F)


If (firstLetter > "A") Then
For x As Integer = 1 to 100
lstBox.Items.Add(x)
Next
End If
T

31. In a For...Next loop, the initial value should be greater than the terminating value if a
negative step is used and the body of the loop is to be executed at least once. (T/F)
T

32. If the counter variable of a For...Next loop will assume values that are not whole numbers,
then the variable should not be of type Integer. (T/F)
T

33. The step value of a For...Next loop can be given by a numeric literal, variable, or expression.
(T/F)
T
34. The variable index declared with the statement For index As Integer = 0 To 5 cannot
be referred to outside of the For…Next loop. (T/F)
T

35. When Option Infer is set to On, a statement of the form Dim num = 7 is valid. (T/F)
T

36. What is displayed in the text box when the button is clicked?
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim word As String = "Alphabet"
Dim abbreviation As String = ""
For i As Integer = 0 To word.Length - 1
If word.Substring(i, 1).ToUpper <> "A" Then
abbreviation &= word.Substring(i, 1)
End If
Next
txtBox.Text = abbreviation
End Sub
lphbet

Section 6.3 List Boxes and Loops

1. Which of the following expressions refers to the contents of the last row of the list box?
(A) lstBox.Items(lstBox.Items.Count)
(B) lstBox.Items(lstBox.Items.Count - 1)
(C) lstBox.Items(Count)
(D) lstBox.Items.Count
B

2. Which of the following expressions refers to the contents of the first row of the list box?
(A) lstBox.Items(0)
(B) lstBox.Items(1)
(C) lstBox.Items.First
(D) lstBox.Items(First)
A

3. Each item in a list box is identified by an index number; the first item in the list is assigned
which of the following values as an index?
(A) a randomly assigned value
(B) 1.
(C) a value initially designated by the programmer
(D) 0
D
4. The following lines of code display all the items of lstBox. (T/F)
For n As Integer = 1 to lstBox.Items.Count
lstBox2.Items.Add(lstBox.Items(n))
Next
F

5. The number of items in ListBox1 is ListBox1.Items.Count. (T/F)


T

6. If no item in a list box is selected, the value of lstBox.SelectedIndex is 0. (T/F)


F

7. Which of the statements will unhighlight any highlighted item in lstBox?


(A) lstBox.SelectedItem = Nothing
(B) lstBox.SelectedItem = ""
(C) lstBox.SelectedIndex = 0
(D) lstBox.SelectedIndex = -1
D

8. A list box named lstBox has its Sorted property set to True and contains the three items Cat,
Dog, and Gnu in its Items collection. If the word Elephant is added to the Items collection at
run time, what will be its index value?
(A) 2
(B) 1
(C) 3
(D) 0
A

9. A list box named lstBox has its Sorted property set to False and contains the three items Cat,
Dog, and Gnu in its list. If the word Elephant is added to the list at run time, what will be its
index value?
(A) 2
(B) 1
(C) 3
(D) 0
C

10. If a program contains procedures for both the Click and DoubleClick events on a list box and the user
double-clicks on the list box, only the Click event will be raised. (T/F)
T

11. If a list box has its sorted property set to True and the list box contains all numbers, then the values in
the list box will always be in increasing numerical order. (T/F)
F
12. If a list box contains all numbers, then which of the following values can be calculated
without using a loop?
(A) average value of the numbers
(B) largest number
(C) smallest number
(D) number of numbers
D

13. Which of the following is not a main type of event that can be raised by user selections of
items in a list box?
(A) Click event
(B) SelectedIndexChanged event
(C) FillDown event
(D) DoubleClick event
C

14. The value of lstBox.Items(n) is the nth item in the list box. (T/F)
F

15. The sorted property can only be set to True at design time. (T/F)
F

16. The _____________ data type is most suited to a flag.


(A) Boolean
(B) Integer
(C) String
(D) Double
A

17. A variable that keeps track of whether a certain situation has occurred is called
(A) a counter.
(B) an accumulator.
(C) a switch.
(D) a flag.
D
Another random document with
no related content on Scribd:
high-speed engine; that being a field into which the liberating system
could not enter. We had quite an argument on this point. I told him
his invention interested me only because it would enable two or
three times the power to be obtained from a given engine without
additional stress on any part, the fly-wheel to be reduced in size, and
the means for getting up the speed of machinery to be largely
dispensed with. I represented to him also that a high-speed engine
ought to be more economical and to give a more nearly uniform
motion.
He finally agreed to my condition, and I took him directly to the
office of Mr. Richards and engaged him to make an analysis and
drawing of Mr. Allen’s system under his direction, and soon
afterwards gave him an order for the plans for an experimental
engine, 6×15 inches, to make 160 revolutions per minute.
As the diagram of the link motion was at first drawn, the center of
the trunnions vibrated in an arc which terminated at points on the line
connecting the center of the engine shaft with the ends of the rocker
arms, and which in the diagram on page 48 is named “radius of link.”
I determined to work out this link motion myself on a large scale.
For this purpose I drew a diagram in which the throw of the eccentric
was 4 inches, and the distance from the center of the shaft to that of
the trunnions of the link in their mid-position was 12 inches. I made a
three-point beam compass. Two of these points were secured
permanently on the beam, 12 inches apart. As one of these points
traversed the path of the center of the eccentric, the other could be
made to traverse the arc of vibration of the trunnions of the link.
I divided the former into 40 equal divisions measured from its dead
points, making needle-holes in the circle, in which the taper
compass-points would center themselves accurately. The paper was
firm and the points of division were fixed with extreme care; and they
lasted through all my experiments. I then set out 20 corresponding
divisions in the arc of vibration of the center of the trunnions. These
showed distinctly the modification of the motion at the opposite ends
of this vibration as already described.
The third point was adjustable on a hinged beam which could be
secured in any position. I drew two arcs representing the lead lines
of the link, or the lines on which the link would stand when the
eccentric was on its dead points. The third point was now secured on
its beam at any point on one of the lead lines, when the other points
stood, one on the dead point of the eccentric and the other at the
end of the trunnion vibration.
The apparatus was now ready for use, the corresponding points
on the circle and the arc being numbered alike. By setting the first
two points in any corresponding holes, the third point would show the
corresponding position of that point of the link at which it was set. I
thus set out the movements of six different points of the link, the
highest being 12 inches above the trunnions. These represented the
movements of the valves of the engine when the block was at these
points in the link. The apparatus being firm, it worked with entire
precision. To my surprise, it showed much the larger valve opening
at the crank end of the cylinder, where the movement of the piston
was slowest. That would not do; we wanted just the reverse.
I called Mr. Allen in and showed him the defect. After considering it
a few minutes, he said he thought it would be corrected by lowering
the trunnions, so that their arc of vibration would coincide with the
line of centers at its middle point, instead of terminating on it. This
was done, and the result was most successful. The lead was now
earlier and the opening wider at the back end of the cylinder, as the
greater velocity of the piston at that point required, and the cut-offs
on the opposite strokes more equal. The link has always been set in
this way, as shown in the diagram.
From this description of the link motion, it will be seen that the
correct vertical adjustment of the trunnions of the link was an
important matter. To enable this adjustment to be made with
precision, and to be corrected, if from wear of the shaft-bearings or
other cause this became necessary, I secured the pin on which
these trunnions were pivoted to the side of the engine bed in the
manner shown in the following figure. To hold the wedge securely,
the surface of the bed below was reduced, so that the wedge was
seized by the flange. The correct position of this pin was determined
by the motions given to the valves.
VERTICAL ADJUSTMENT
OF SUSTAINING PIN
FOR TRUNNIONS
OF THE ALLEN LINK

I now took a more prominent part myself in steam-engine design. I


had got an idea from Mr. Sparks that took full possession of my
mind. This was the exceedingly unmechanical nature of the single or
overhanging crank. The engines of the “New York,” built by Caird &
Co., of Greenock, were among the first of the direct inverted-cylinder
engines applied to screw propulsion. They were then known as the
steam-hammer engines, their leading feature being taken from Mr.
Nasmyth’s invention. I am not sure but Caird & Co. were the first to
make this application. The forward engine had a single crank. The
vital defect of this construction became especially apparent in these
vertical engines of large power. The stress on the cap bolts during
the upward strokes and the deflection of the shaft alternately in
opposite directions over the pillow-block as a fulcrum were very
serious. Mr. Sparks told me that on his very first voyage he had a
great deal of trouble with this forward bearing, and it caused him
continual anxiety. He got into such a state of worry and
apprehension that as soon as he reached New York he wrote to the
firm: “For God’s sake, never make another pair of engines without
giving a double crank to the forward engine.” The reply he got was,
to mind his own business: they employed him to run their engines;
they would attend to the designing of them. He told me not long after
that he had the satisfaction of seeing every ship they built except his
own disabled, either by a broken shaft or broken pillow-block bolts.
He attributed the escape of the “New York” from a like disaster to his
own extreme care. They did, however, adopt his suggestion on all
future vessels, and, moreover, added a forward crank and pillow-
block to the engines already built. This they evidently found
themselves compelled to do. I saw this addition afterwards on the
“Bremen,” sister ship to the “New York.” The added pillow-block was
supported by a heavy casting bolted to the forward end of the
bedplate.
I went everywhere visiting engines at work and in process of
construction, to observe this particular feature of the overhanging
crank, which was universal in horizontal engines. In this class of
engines, running slowly, its defective nature was not productive of
serious consequences, because no stress was exerted on the cap
bolts and the shaft was made larger in proportion to the power of the
engine, as it had to carry the fly-wheel. But I was astonished to see
the extent to which the overhang of the single crank was allowed.
Builders seemed to be perfectly regardless of its unmechanical
nature. First, the crank-pin was made with a length of bearing
surface equal to about twice its diameter; then a stout collar was
formed on the pin between its bearing surface and the crank. The
latter was made thick and a long hub was formed on the back of it. I
was told that the long hub was necessary in order to give a proper
depth of eye to receive the shaft. This being turned down smaller
than the journal, so that the crank might be forced on up to a
shoulder, the eye needed to be deep or the crank would not be held
securely. Finally, the journal boxes were made with flanges on the
ends, sometimes projecting a couple of inches. Altogether, the
transverse distance from the center line of the engine to the solid
support of the shaft in the pillow-block was about twice what it
needed to be. I also saw in some cases the eccentric placed
between the crank and the pillow-block. Fifteen years later I saw a
large engine sent from Belgium to our 1876 Exhibition which was
made in this manner.
I determined at once that such a construction would not do for
high-speed engines, and proceeded to change every one of these
features. The single crank could not be avoided, but its overhang
could be much reduced.
OLD AND NEW CRANKS
AND JOURNAL BOXES.
THE CRANKS ARE SHOWN IN
THE VERTICAL POSITION.
CRANKS AND TOP AND
BOTTOM
BOXES ARE SHOWN IN
SECTION.

The following sketches show the changes which were then made,
and all of which have been retained. The inside collar on the crank-
pin was dispensed with and the diameter of the pin was made
greater than its length, the projected area being generally increased.
The shank of the pin was made larger and shorter, and was riveted
at the back. Instead of turning the shaft down smaller than the
journal to receive the crank, I made it with a large head for this
purpose. The keyway could then be planed out and the key fitted
above the surface of the journal, and the joint was so much further
from the axis that but little more than one half the depth was required
in the crank-eye.
Mr. Corliss had already discarded the flanged boxes. He also first
made this bearing in four parts. The wear in the horizontal direction,
the direction of the thrust, could then be taken up. For this purpose
he used two bolts behind the front side box only. I modified his
construction by making the side boxes wider and taking up their
wear by wedges behind both of them, thus preserving the alignment.
One wedge could also be placed close to the crank. The dotted lines
show the width of the side boxes and the location of the wedges.
The shaft was made with a collar to hold the bearings in place, and
was enlarged in its body. The substitution in place of the crank of the
entire disk carrying a counterweight completed these changes. This
was the fruit of my first lesson in high-speed engine designing, which
had unconsciously been given to me by Mr. Sparks. The oil passage
in the pin was added later, as will be described.
I had another piece of good luck. I happened one day to see in the
Novelty Iron Works the hubs being bored for the paddle-wheels of
the new ship for the Collins line—the “Adriatic.” These were perhaps
the largest castings ever made for such a purpose. I observed that
they were bored out only half-way around. The opposite side of the
hole had been cored to about half an inch greater radius, and three
key-seats were cored in it, which needed only to be finished in the
key-seating machine. The idea struck me that this would be an
excellent way to bore fly-wheels and pulleys. As commonly bored, so
that they could be put on the shaft comfortably they were bored too
large, their contact with the shaft could then be only on a line
opposite the key, and the periphery could not run perfectly true.
I adopted the plan of first boring to the exact size of the shaft and
then shifting the piece about an eighth of an inch, and boring out a
slender crescent, the opposite points of which extended a little more
than half-way around. The keyway was cut in the middle of this
enlargement. The wheel could then be readily put on to the shaft,
and when the key was driven up contact was made over nearly one
half the surface and the periphery ran dead true. I remember seeing
this feature much admired in London, and several times heard the
remark, “I should think the key would throw it some.”
To prevent fanning I made the fly-wheel and pulley with arms of
oval cross-section. These have always been used by me. They have
done even better than I expected. They are found to impart no
motion to the air, however rapidly they may be run.
Flanges on the Eccentric.

Flanges on the Strap.

As already stated, the Allen valve-gear required the position of the


eccentric to coincide with that of the crank, so that these should pass
their dead points simultaneously. To insure this and to make it
impossible for the engineer to advance his eccentric, which he would
be pretty sure to do if he could, I made the eccentric solid on the
shaft. This also enabled me to make it smaller, the low side being
brought down nearly to the surface of the shaft. The construction,
moreover, was substantial and saved some work.
All eccentrics that I had seen were flanged on each side to keep
the strap in place. I observed the oil to work out freely between the
flanges and the strap. This action would of course be increased in
high-speed engines. So I reversed the design, as shown in the
above sections of these two bearings at the top of the eccentric,
putting the flanges on the strap instead of on the eccentric.
It will be seen that the more rapid the speed the more difficult it
becomes to keep the oil in the first bearing, and the more difficult it
becomes for it to get out of the second one. I ought to have adopted
the same construction for the main shaft journal, but in all the years I
was making engines it never occurred to me. I contented myself with
turning a groove in the hub of the crank, as shown to prevent the oil
from getting on the disk.
The problem of crank-pin lubrication at high speed at once
presented itself and had to be met. I finally solved it in the manner
partially shown on page 54. A wiper was bolted on the back of the
crank, and from it a tube entered the diagonal hole in the pin. This
always worked perfectly. This wiper and the oil cup are shown on
page 230. Other devices have been employed by various makers of
high-speed engines, but I always adhered to this one. It has the
advantage of being equally applicable to double-crank engines.
Aside from the above features, the design for my exhibition engine
was made by Mr. Richards.
CHAPTER V

Invention of the Richards Indicator. My Purchase of the Patent. Plan my London


Exhibition. Engine Design. Ship Engine Bed to London, and sail myself.

he subject of an indicator directly presented itself. Mr.


Allen invited Mr. Richards and myself to his engine-
room, and took diagrams for us with a McNaught
indicator. This was the first indicator that either of us
had ever seen. Indicators were then but little known in
this country. The Novelty Iron Works made a very few
McNaught indicators, almost the only users of which were the Navy
Department and a few men like Mr. Ericsson, Mr. Stevens, Mr.
Sickels, and Mr. Corliss. I told Mr. Richards that we must have a
high-speed indicator and he was just the man to get it up for us. He
went to work at it, but soon became quite discouraged. He twice
gave it up. He could not see his way. I told him I was not able to
make any suggestion, but the indicator we must have, and he had to
produce it. After some months he handed me a drawing of an
indicator which has never been changed, except in a few details.
This important invention, which has made high-speed engineering
possible, came from the hands of Mr. Richards quite complete. Its
main features, as is well known, are a short piston motion against a
short, stiff spring; light multiplying levers, with a Watt parallel motion,
giving to the pencil very nearly a straight line of movement; and a
free rotative motion of the pencil connections around the axis of the
piston, which itself is capable of only the slight rotation caused by the
compression or elongation of the spring. Elegant improvements have
since been made, adapting the indicator to still higher engine
speeds; but these have consisted only in advancing further on the
lines struck out by Mr. Richards. In fact, this was all that could be
done—giving to the piston a little less motion, lightening still further
the pencil movement, and making the vertical line drawn by the
pencil more nearly a straight line.

DIAGRAM TAKEN SEPTEMBER 13, 1861,


FROM THE FIRST ALLEN ENGINE
BY THE FIRST RICHARDS INDICATOR.
ENGINE, 6 INCHES BY 15 INCHES,
MAKING 160 REVOLUTIONS PER
MINUTE.
THIS CARD WAS RUN OVER TWENTY
TIMES.

I took Mr. Richards’ drawing to the Novelty Iron Works and had an
indicator ready for use when the engine was completed. The engine
was made by the firm of McLaren & Anderson, on Horatio Street,
New York, for their own use. It was set up by the side of their throttle-
valve engine, and was substituted for it to drive their machinery and
that of a kindling-wood yard adjoining for which they furnished the
power. It ran perfectly from the start, and saved fully one half of the
fuel. In throttle-valve engines in those days the ports and pipes were
generally so small that only a part of the boiler pressure was realized
in the cylinder, and that part it was hard to get out, and nobody knew
what either this pressure or the back pressure was. I have a diagram
taken from that engine, which is here reproduced.
The indicator was quickly in demand. One day when I was in the
shop of McLaren & Anderson, engaged in taking diagrams from the
engine, I had a call from the foreman of the Novelty Iron Works. He
had come to see if the indicator were working satisfactorily, and if so
to ask the loan of it for a few days. The Novelty Iron Works had just
completed the engines for three gunboats. These engines were to
make 75 revolutions per minute, and the contract required them to
be run for 72 consecutive hours at the dock. They were ready to
commence this run, and were anxious to indicate the engines with
the new indicator.
I was glad to have it used, and he took it away. I got it back after
two or three weeks, with the warmest praise; but none of us had the
faintest idea of the importance of the invention.
I remember that I had to go to the Novelty Works for the indicator,
and was asked by Mr. Everett, then president of the company, if we
had patented it, for if we had they would be glad to make them for
us. The idea had not occurred to me, but I answered him promptly
that we had not, but intended to. I met Mr. Allen at Mr. Richards’
office, and told them Mr. Everett’s suggestion, and added, “The first
question is, who is the inventor, and all I know is that I am not.” Mr.
Allen added, “I am not.” “Then,” said Mr. Richards, “I suppose I shall
have to be.” “Will you patent it?” said I. “No,” he replied; “if I patent
everything I think of I shall soon be in the poorhouse.” “What will you
sell it to me for if I will patent it?” I asked. “Will you employ me to
obtain the patent?” he replied. “Yes.” “Well, I will sell it to you for a
hundred dollars.” “I will take it, and if I make anything out of it will pay
you ten per cent. of what I get.” This I did, so long as the patent
remained in my hands.
The success of the stationary and the marine governors and of the
engine and the indicator fired me, in the summer of 1861, with the
idea of taking them all to the London International Exhibition the next
year. The demonstration of the three latter seemed to have come in
the very nick of time. For this purpose I fixed upon an engine 8
inches diameter of cylinder by 24 inches stroke, to make 150
revolutions per minute, and at once set Mr. Richards at work on the
drawings for it. I thought some of speeding it at 200 revolutions per
minute, but feared that speed would frighten people. That this would
have been a foolish step to take became afterwards quite apparent.
Joseph E. Holmes

That summer I made application for space in the London


Exhibition of 1862, and soon after was waited upon by the Assistant
United States Commissioner, Mr. Joseph E. Holmes. So far as the
engine to be exhibited was concerned, I had nothing to show Mr.
Holmes. The drawings were scarcely commenced. I, however, took
him to McLaren & Anderson’s shop and showed him the little engine
at work there and took diagrams from it in his presence, and
expatiated on the revolution in steam-engineering that was there
inaugurated, but which has not yet been realized to the extent I then
dreamed of. It was evident that Mr. Holmes was much impressed
with the assurance of the success of the new system that the perfect
running of this first little engine seemed to give. I told him that the
engine for the exhibition would certainly be completed, and on that
assurance he accepted my entire proposed exhibit. I did not see him
again until we met the next spring in London, under the somewhat
remarkable circumstances hereafter to be related.
In spite of all efforts it was found impossible to complete the
engine and have it tested before shipment as I had intended. Indeed,
as the time approached after which no further exhibits would be
received, two things grew more and more doubtful. One was whether
the engine could be got off at all, and the other whether I could
obtain the means to make the exhibit. Finally I managed to get the
engine bed finished and immediately shipped it by a mail steamer.
A small, slow steamer chartered by the United States Commission
and loaded with exhibits had sailed previously, carrying the assistant
commissioner and a number of exhibitors and their representatives,
who, until they reached their destination, remained in blissful
ignorance of what happened directly after their departure.
But to return to my own movements. Mr. Hope one day said to me:
“I understand you shipped your engine bed last Saturday; what did
you do that for? You don’t know yet whether you can go yourself.” I
replied: “If I had not shipped it then, I should lose my space and
would have to abandon the exhibition altogether. If I find that I can’t
go, the bed can come back.” I redoubled my exertions to get the
remaining parts of the engine completed and to raise the necessary
funds. The next Saturday I shipped everything that was ready. On
the following Monday, by making a large sacrifice, I realized a sum
that could be made to answer, and on Wednesday I sailed on the
Cunard steamer “Africa,” leaving to my reliable clerk, Alexander
Gordon, long President of the Niles Tool Works, and now Chairman
of the Board of Directors of the Niles-Bement-Pond Company, the
responsibility of seeing that everything still wanting should follow as
rapidly as possible.
I left, not knowing an Englishman in the whole island, to have the
parts of an engine, the first one from the drawings and the first
engine I ever made, brought together for the first time by I had no
idea whom, and assembled and put in motion before the eyes of the
world. But I had no misgivings. The engine had been built in my own
shop, under my constant supervision, and by workmen trained to the
greatest accuracy. The crank-pin I had hardened and ground by my
friend Mr. Freeland. I knew the parts would come together perfectly.
The result justified my confidence.
One incident of the voyage is worth recording. As we were leaving
port we passed the “China,” the first screw steamer of the Cunard
fleet, coming in on her maiden voyage.
We had some rough weather, sometimes with a following sea. I
was much interested at such times in watching the racing of the
engines, when occasionally both paddle-wheels would be revolving
in the air in the trough of the sea. The feature that especially
attracted my notice was that the faster the engines ran the more
smoothly they ran. It was certainly a fascinating sight to see these
ponderous masses of metal, the parts of great side-lever engines,
gliding with such velocity in absolute silence. The question what
caused them to do so it did not occur to me to ask.
Alexander Gordon

Being anxious to reach London as quickly as possible, after a


tedious voyage of twelve days, I left the steamer at Cork, to go
through with the mail. The custom-house inspectors first interested
me. On the little boat by which the mail is transferred from the ship to
the shore, two of the representatives of Queen Victoria were anxious
to know if I had any liquor or tobacco in my trunk, these being the
only dutiable articles. They were quite satisfied with my reply in the
negative. A personal examination they never thought of. Truthful
themselves, I moralized, they do not suspect untruth in others. Their
next question was, “Have you got the price of a glass of beer about
you?” I made them happy with a half crown, several times their
modest request, and they stamped me as an American free with his
money. I purchased a first-class ticket to London, and received the
assurance that I should go through with the mail. I was the only
passenger on the train of two coaches, besides the mail-van. It was
late at night. The regular passenger-train had gone some hours
before. Not being up in the English ways, I did not know how I might
make myself comfortable, but sat up all night, dozing as I could. I did
not sleep after two o’clock. In that high latitude it was already light
enough to see fairly well.
After that hour the railroad ran through a farming country all the
way to Dublin. I was amused with the queer shapes of the fields.
These were generally small, and running into sharp corners,
regardless of convenience in cultivation. They were separated
always by hedges and ditches. A ditch was dug some two feet deep
and three or four feet wide, the dirt was thrown up into a bank to
correspond on one side, and on this bank was planted a hedge of
hawthorn—“quick-set” they commonly called it. These hedges were
of all ages, from those young and well kept to those in all stages of
growth and dilapidation. I could have passed everywhere from field
to field through breaks in the hedges, sometimes wide ones. I could
not see of what use they were except for hunters to jump over. Saw
occasionally a laborer’s cabin, sometimes a group of them. When an
Irishman came out to sun himself, he always stood higher than the
eaves of his thatched roof. Occasionally a more pretentious house
would appear. These were all alike, painted white, full of windows,
very thin from front to back, and looked like waffles set on edge.
Never did I see a tree or a bush about a house to relieve the
appearance of barrenness, but there were often small trees in the
hedge-rows.
The railway station on one side of Dublin was about four miles
from the station on the opposite side, from which a short railway ran
to Kingston, a point a little distance south of Dublin, from which the
channel boats crossed to Holyhead. There being no other means of
conveyance, I rode through Dublin in an open van sitting on the mail-
bags. At the Kingston station an empty train stood waiting for the
mails. The regular passenger-train had gone some time before, but
the boat at Kingston was also waiting for the mail. I got into a
carriage, having ordered my trunk put into the baggage-van, but was
ordered out by the guard. I showed him my ticket, and was told that I
would have to see the superintendent. That official appeared, and
told me this train was for the mails. It had an empty passenger-
coach. I showed him my ticket and told him the assurance on which I
had bought it, that I should go through with the mails. He replied that
the passenger-train had gone, I should have been here to take it.
Said he was very sorry, but it was impossible. I got mad. My trunk
stood on the platform. As nobody would touch it, I took it up and put
it into the open door of the baggage-van myself. The superintendent
ordered two men to take it out, which they did. I told him of my great
anxiety to reach London that afternoon. All the reply he made was to
repeat that he was very sorry, but it was impossible, and I was
compelled to stand there and see that train move off, and fool away
the whole day in Dublin. Does the reader want to know what the
matter was? If he does not know already, he is as green as I was. I
had not given the superintendent two and sixpence. But I had more
yet to learn about England and the English, and much more serious.

You might also like