Solution Manual for Data Abstraction and Problem Solving with Java: Walls and Mirrors, 3/E 3rd Edition : 0132122308download
Solution Manual for Data Abstraction and Problem Solving with Java: Walls and Mirrors, 3/E 3rd Edition : 0132122308download
http://testbankbell.com/product/solution-manual-for-data-
abstraction-and-problem-solving-with-java-walls-and-
mirrors-3-e-3rd-edition-0132122308/
http://testbankbell.com/product/test-bank-for-data-abstraction-and-
problem-solving-with-java-walls-and-mirrors-3-e-3rd-
edition-0132122308/
http://testbankbell.com/product/solution-manual-for-data-abstraction-
and-problem-solving-with-c-walls-and-mirrors-7th-editioncarrano/
http://testbankbell.com/product/solutions-manual-to-accompany-power-
systems-analysis-and-design-4th-edition-9780534548841/
Freedom on My Mind Volume 2 A History of African Americans
with Documents 2nd Edition White Test Bank
http://testbankbell.com/product/freedom-on-my-mind-volume-2-a-history-
of-african-americans-with-documents-2nd-edition-white-test-bank/
http://testbankbell.com/product/test-bank-for-global-issues-politics-
economics-and-culture-5th-edition-richard-j-payne/
http://testbankbell.com/product/development-across-the-life-span-
feldman-7th-edition-solutions-manual/
http://testbankbell.com/product/solution-manual-for-think-social-
psychology-2012-edition-by-duff/
http://testbankbell.com/product/test-bank-for-organic-chemistry-12th-
edition-by-solomons/
Test Bank for CJ2, 2nd Edition : Gaines
http://testbankbell.com/product/test-bank-for-cj2-2nd-edition-gaines/
Solution Manual for Data Abstraction and
Problem Solving with Java: Walls and
Mirrors, 3/E 3rd Edition : 0132122308
Full download chapter at: https://testbankbell.com/product/solution-
manual-for-data-abstraction-and-problem-solving-with-java-walls-and-
mirrors-3-e-3rd-edition-0132122308/
Chapter 2
2 Use a class Money that stores the number of dollars and cents as private data
members. When declaring new objects or changing the data of existing ones, the
class methods should ensure that if the number of cents exceeds 99, the number
of dollars and cents are changed to represent the monetary amount in its most
reduced form.
return newTime;
}
// 1. Bad idea to have "import java.io.*". Just import what you use.
// 2. Also, need to import classes from other packages besides io.
import java.io.FileNotFoundException;
import java.io.FileInputStream;
import java.util.Scanner;
fileInput.close();
5b At a minimum, the Person class will have three attributes: a name (String), a collection of friends (could be
implemented as array of Person), and a buffer containing the message(s) from friends (a single String, or
array of String).
The Person class should have a constructor. A Person begins with a name but no friends and a blank
message buffer.
Instance methods:
First, we need sendRequest(Person p), which identifies whether Person p can be friends with me. If this
method returns true, then we need to add p to the list of my friends, and make sure p adds me to the list of
his/her friends. For simplicity, let’s assume that a friend request will always be honored, unless a person
has reached some arbitrary maximum number. In this case, we need to have access to the number of
friends p has.
We need an addFriend(Person p) method, so that the other person can add me to his/her list of friends.
We need sendMessage(String s), which broadcasts a message to all my friends. Each of my friends needs
to append this message string into his/her buffer of messages.
Finally, we need some way of modifying the buffer of one of my friends, so we do this with a
setBuffer(String s). This is an implementation detail inside sendMessage( ), so this does not need to be
made public.
5c Person
-------------------------------------------
- name: string
- friends: array of Friend
- buffer: string
-------------------------------------------
+ sendRequest(in p: Person) { query }
- findNumberFriends( ) { query }
+ addFriend(in p: Person)
+ sendMessage(in s: string)
- setBuffer(in s: string)
6 Automobile
--------------------------------------
- make: string
- model: string
- year: integer
- licencePlate: string
- mileage: integer
- gallons: double
- location: string
--------------------------------------
+ getMake( ) { query }
+ getModel( ) { query }
+ getYear( ) { query }
+ getLicencePlate( ) { query }
+ getMileage( ) { query }
+ buyGas(in gallons: double)
+ drive(in gallons: double, in miles: integer)
+ getLocation( ) { query }
+ setLocation( ) { query }
Person
- name: string
- address: string
- ID: integer
+ getName( ) { query }
+ getAddress( ) { query }
+ getID( ) { query }
Course
- title: string Student
Faculty - code: string - campusAddress: string
- department: string - meetingTime: string - major: string
- salary: double 1 * + getCampusAddress( )
+ getDepartment ( ) + getTitle( ) { query } 1 *
{query}
{ query } + getCode( ) { query } + getMajor( ) { query }
- getSalary( ) { query} + getMeetingTime( ) + addCourse( in c:Course)
+ addCourse(in { query } + dropCourse(in c:Course)
c:Course )
9a Precondition: The array is nonempty, the elements are numerical, and each value in the array is in the
appropriate range of values for the application (e.g. 0 to 100).
Postcondition: The method will return the average of the array elements.
Postcondition: The method will return a positive real number representing the corresponding BMI.
9c Precondition: The loan amount and interest rate will be positive real numbers. The number of months will
be a positive integer. In particular, the interest rate will be expressed as a number of percent that loans are
typically quoted at: for example the number 5.0 will mean the annual interest rate is 5%.
Postcondition: The method will return the value of the loan payment.
10 Yes, an assertion statement can help isolate bugs. For example, you can verify that the preconditions to a
method are satisfied. If they are not, then you can conclude that a bug exists before the method was called.
Also, if the postcondition of a method guarantees some property of a return value (e.g. that it is positive),
then this can be checked as well.
11 This is an infinite loop. The loop will never terminate because the condition will always be true.
12 Transaction
----------------------------
- date: string
- time: string
- amount: double
- isChecking: boolean
-----------------------------
+ getDate( ) { query }
+ getTime( ) { query }
+ getAmount( ) { query }
+ getType( ) { query }
13 The value of numItems might be zero, negative, or larger than the size of the array. We should throw an
exception in case the value of numItems is out of range.
We should also take a step back and ask ourselves if we really need a method that averages the first
numItems values of an array. If the only time we ever average an array is to average all of its elements,
then this second parameter isn’t even necessary. Note that an array already has a built-in length
attribute.
15 The value of sum is the sum of all of the positive values among the first index values in array item.
16 public class ex1_8
{
public static void main (String[] args)
{
int n = 5;
int square = 1;
for (int i = 1; i <=n; i++)
{
square = i * i;
System.out.println(square);
}
}
}
while(temp1 <= X)
Debugging involves printing the values of temp1, temp2 and result at the top of the loop.
c.) Supply user prompts and check the value of x to ensure that it is greater than 0.
19
import java.util.Scanner;
try {
age = Integer.parseInt(kbd.nextLine());
}
catch(NumberFormatException e) {
System.out.println("Error: age should be integer.");
continue;
}
Title: On the History of Gunter's Scale and the Slide Rule During
the Seventeenth Century
Language: English
BY
FLORIAN CAJORI
[187
TABLE OF CONTENTS
PAGE
I. Introduction 187
II. Innovations in Gunter’s Scale 188
Changes introduced by Edmund Wingate 188
Changes introduced by Milbourn 189
Changes introduced by Thomas Brown and John Brown 190
Changes introduced by William Leybourn 192
III. Richard Delamain’s “Grammelogia” 192
Different editions or impressions 194
Description of Delamain’s instrument of 1630 195
Delamain’s later designs, and directions for using his instruments
197
IV. Controversy between Oughtred and Delamain on the invention of
the circular slide rule
199
V. Independence and priority of invention 203
VI. Oughtred’s “Gauging Line,” 1633 206
VII. Other seventeenth century slide rules 207
I. INTRODUCTION
[1] [2]
In my history of the slide rule , and my article on its invention it is
shewn that William Oughtred and not Edmund Wingate is the
inventor, that Oughtred’s circular rule was described in print in 1632,
his rectilinear rule in 1633. Richard Delamain is referred to as having
[3]
tried to appropriate the invention to himself and as having written a
scurrilous pamphlet against Oughtred. All our information about [188
[4]
Delamain was taken from De Morgan, who, however, gives
no evidence of having read any of Delamain’s writings on the slide
rule. Through Dr. Arthur Hutchinson of Pembroke College, Cambridge,
I learned that Delamain’s writings on the slide rule were available. In
this article will be given: First, some details of the changes introduced
during the seventeenth century in the design of Gunter’s scale by
Edmund Wingate, Milbourn, Thomas Brown, John Brown and William
Leybourn; second, an account of Delamain’s book of 1630 on the
slide rule which antedates Oughtred’s first publication (though
Oughtred’s date of invention is earlier than the date of Delamain’s
alleged invention) and of Delamain’s later designs of slide rules; third,
an account of the controversy between Delamain and Oughtred;
fourth, an account of a later book on the slide rule written by William
Oughtred, and of other seventeenth century books on the slide rule.
II. INNOVATIONS IN GUNTER’S
SCALE
The English editions of this book which appeared in 1623 and [189
1628 are devoid of interest. The editions of 1645 and 1658
[7]
contain an important innovation. In the preface the reasons why
this instrument has not been used more are stated to be: (1) the
difficulty of drawing the lines with exactness, (2) the trouble of
working thereupon by reason (sometimes) of too large an extent of
the compasses, (3) the fact that the instrument is not readily
portable. The drawing of Wingate’s arrangement of the scale in the
editions of 1645 and 1658 is about 66 cm. (26.5 in.) long. It contains
five parallel lines, about 66 cm. long, each having the divisions of one
line marked on one side and of another line on the other side. Thus
each line carries two graduations: (1) A single logarithmic line of
numbers; (2) a logarithmic line of numbers thrice repeated; (3) the
first scale repeated, but beginning with the graduations which are
near the middle of the first scale, so that its graduation reads 4, 5, 6,
7, 8, 9, 1, 2, 3; (4) a logarithmic line of numbers twice repeated; (5)
a logarithmic line of tangents; (6) a logarithmic line of sines; (7) the
rule divided into 1000 equal parts; (8) the scale of latitudes; (9) a line
of inches and tenths of inches; (10) a scale consisting of three kinds,
viz., a gauge line, a line of chords, and a foot measure, divided into
1000 equal parts.
Important are the first and second scales, by which cube root
extraction was possible “by inspection only, without the aid of pen or
compass;” similarly the third and fourth scales, for square roots. This
innovation is due to Wingate. The 1645 edition announces that the
instrument was made in brass by Elias Allen, and in wood by John
Thompson and Anthony Thompson in Hosier Lane.
Changes introduced by Milbourn
William Leybourn, in his The Line of Proportion or Numbers,
Commonly called Gunter’s Line, Made Easie, London, 1673, says in his
preface “To the Reader:”
This Mr. Milburn is probably the person named in the diary of [190
the antiquarian, Elias Ashmole, on August 13 [1646?]; “I
bought of Mr. Milbourn all his Books and Mathematical
[8] [9]
Instruments.” Charles Hutton says that Milburne of Yorkshire
designed the spiral form about 1650. This date is doubtless wrong,
for Thomas Browne who, according to Leybourn, got the spiral form
of line from Milbourn, is repeatedly mentioned by William Oughtred in
[10]
his Epistle printed some time in 1632 or 1633. Oughtred does not
mention Milbourn, and says (page 4) that the spiral form “was first hit
upon by one Thomas Browne a Joyner, . . . the serpentine revolution
[11]
being but two true semicircles described on severall centers.”
1. First next the center is two circles divided one into 60, the other
into 100 parts, for the reducing of minutes to 100 parts, and the
contrary.
2. You have in seven turnes two inpricks, and five in divisions, the
first Radius of the sines (or Tangents being neer the matter, alike to
the first three degrees,) ending at 5 degrees and 44 minutes.
The versed sines are set after the manner of Mr. Gunter’s Cross-
staff, and divided into every 10th minutes beginning at 0, and
proceeding to 156 going backwards under the line of Tangents.
8. Eightly and lastly, in the space place between the ending of the
middle five turnes, and one half of the circle are three prickt lines
fitted for reduction. The uppermost being for shillings, pence and
farthings. The next for pounds, and ounces, and quarters of small
Averdupoies weight. The last for pounds, shillings and pence, and
to be used thus: If you would reduce 16s. 3d. 2q. to a decimal
fraction, lay the hair or edge of one of the legs of the index on 16.
3½ in the line of 1. s. d. and the hair shall cut on the equal parts
81 16; and the contrary, if you have a decimal fraction, and would
reduce it to a proper fraction, the like may you do for shillings, and
pence, and pounds, and ounces.
As to the use of these lines, I shall in this place say but little, and
that for two reasons. First, because this instrument is so contrived,
that the use is sooner learned then any other, I speak as to the
manner, and way of using it, because by means of first second and
third radiusses, in sines and Tangents, the work is always right on,
one way or other, according to the Canon whatsoever it be, in any
book that treats of the Logarithms, as Gunter, Wells, Oughtred,
Norwood, or others, as in Oughtred from page 64 to 107.
1. Which soever of the two legs is set to the first term in the
question, that I call the first leg always, and the other being set to
the second term, I call the second leg . . .
The exact nature of the contrivance with the “two legs” is not
described, but it was probably a flat pair of compasses, attached to
the metallic surface on which the serpentine line was drawn. In that
case the instrument was a slide rule, rather than a form of Gunter’s
[13]
line. In his publication of 1661, as also in later publications, [192
John Brown devoted more space to Gunter’s scales, requiring the use
of a separate pair of compasses, than to slide rules.
[194
In Grammelogia I the first three leaves and the last leaf are without
pagination. The first leaf contains the title-page; the second leaf, the
dedication to the King and the preface “To the Reader;” the third leaf,
the description of the Mathematical Ring. Then follow 22 [195
numbered pages. Counting the unnumbered pages, there are
altogether 30 pages in the pamphlet. Only the first three leaves of
this pamphlet are omitted in Grammelogia IV and V.
The parts of the Instrument are two Circles, the one moveable, and
the other fixed; The moveable is that unto which is fastened a
small pin to move it by; the other Circle may be conceived to be
fixed; The circumference of the moveable Circle is divided into
unequall parts, charactered with figures thus, 1. 2. 3. 4. 5. 6. 7. 8.
9. these figures doe represent themselves, or such numbers unto
which a Cipher or Ciphers are added, and are varied as the
occasion falls out in the speech of Numbers, so 1. stands for 1. or
10. or 100., &c. the 2. stands for 2. or 20. or 200. or 2000., &c. the
3. stands for 30. or 300. or 3000., &c.
Seeke the first number in the moveable, and bring it to the second
number in the fixed, so right against the third number in the
moveable, is the answer in the fixed.
If the Interest of 100. li. be 8. li. in the yeare, what is the Interest
of 65. li. for the same time.
Bring 100. in the moveable to 8. in the fixed, so right against 65. in
the moveable is 5.2. in the fixed, and so much is the Interest of 65.
li. for the yeare at 8. li. for 100. li. per annum.
The Instrument not removed, you may at one instant right [197
against any summe of money in the moveable, see the
Interest thereof in the fixed: the reason of this is from the
Definition of Logarithmes.
These are the earliest known printed instructions on the use of a slide
rule. It will be noticed that the description of the instrument at the
opening makes no references to logarithmic lines for the
trigonometric functions; only the line of numbers is given. Yet the
title-page promised the “resolution of Plaine and Sphericall Triangles.”
Page 22 throws light upon this matter:
That which I have formerly delivered hath been onely upon one of
the Circles of my Ring, simply concerning Arithmeticall Proportions,
I will by way of Conclusion touch upon some uses of the Circles, of
Logarithmall Sines, and Tangents, which are placed on the edge of
both the moveable and fixed Circles of the Ring in respect of
Geometricall Proportions, but first of the description of these
Circles.
First, upon the side that the Circle of Numbers is one, are
graduated on the edge of the moveable, and also on the edge of
the fixed the Logarithmall Sines, for if you bring 1. in the moveable
amongst the Numbers to 1. in the fixed, you may on the other edge
of the moveable and fixed see the sines noted thus 90. 90. 80. 80.
70. 70. 60. 60. &c. unto 6.6. and each degree subdivided, and then
over the former divisions and figures 90. 90. 80. 80. 70. 70. &c.
you have the other degrees, viz. 5. 4. 3. 2. 1. each of those divided
by small points.
Secondly, (if the Ring is great) neere the outward edge of [198
this side of the fixed against the Numbers, are the usuall
divisions of a Circle, and the points of the Compasse: serving for
observation in Astronomy, or Geometry, and the sights belonging to
those divisions, may be placed on the moveable Circle.
. . . you may make use of the Projection of the Circles of the Ring
upon a Plaine, having the feet of a paire of compasses (but so that
they be flat) to move on the Center of that Plaine, and those feet to
open and shut as a paire of Compasses . . . now if the feet bee
opened to any two termes or numbers in that Projection, then may
you move the first foot to the third number, and the other foot shall
give the Answer; . . . it hath pleased some to make use of this way.
But in this there is a double labour in respect to that of the Ring,
the one in fitting those feet unto the numbers assigned, and the
other by moving them about, in which a man can hardly
accommodate the Instrument with one hand, and expresse the
Proportionals in writing with the other. By the Ring you need not
but bring one number to another, and right against any other
number is the Answer without any such motion. . . . upon that [the
Ring] I write, shewing some uses of those Circles amongst
themselves, and conjoyned with others . . . in Astronomy,
Horolographie, in plaine Triangles applyed to Dimensions,
Navigation, Fortification, etc. . . . But before I come to
Construction, I have thought it convenient by way introduction, to
examine the truth of the graduation of those Circles . . .
Which thing while I with mature, and diligent care (as my occasions
would give me leaue) went about to doe: another to whom the
Author in a louing confidence discouered this intent, using more
hast then good speed, went about to preocupate; of which vntimely
birth, and preuenting (if not circumuenting) forwardnesse, I say no
more: but aduise the studious Reader, onely so farre to trust, as he
shal be sure doth agree to truth & Art.
All parts of Delamain’s Grammelogia IV, except pages 1-22 and 53-68
considered above, were published after the Circles of Proportion, for
they contain references to the ill treatment that Delamain felt or
made believe that he felt, that he had received in the book published
by Oughtred and Forster. Oughtred’s reference to teachers whose
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
testbankbell.com