Introduction to Java Programming Comprehensive Version 9th Edition Liang Test Bank PDF Download Full Book with All Chapters
Introduction to Java Programming Comprehensive Version 9th Edition Liang Test Bank PDF Download Full Book with All Chapters
com
https://testbankfan.com/product/introduction-to-java-
programming-comprehensive-version-9th-edition-liang-test-
bank/
OR CLICK HERE
DOWLOAD NOW
https://testbankfan.com/product/introduction-to-java-programming-
comprehensive-version-10th-edition-liang-test-bank/
testbankfan.com
https://testbankfan.com/product/introduction-to-java-programming-
comprehensive-version-10th-edition-liang-solutions-manual/
testbankfan.com
https://testbankfan.com/product/introduction-to-java-programming-
brief-version-10th-edition-liang-test-bank/
testbankfan.com
https://testbankfan.com/product/principles-of-marketing-ninth-
canadian-edition-canadian-9th-edition-kotler-test-bank/
testbankfan.com
Practical Investment Management 4th Edition Strong
Solutions Manual
https://testbankfan.com/product/practical-investment-management-4th-
edition-strong-solutions-manual/
testbankfan.com
https://testbankfan.com/product/auditing-art-and-science-of-assurance-
engagements-13th-edition-aren-test-bank/
testbankfan.com
https://testbankfan.com/product/financial-accounting-ifrs-edition-2nd-
edition-weygandt-test-bank/
testbankfan.com
https://testbankfan.com/product/chemistry-10th-edition-whitten-
solutions-manual/
testbankfan.com
https://testbankfan.com/product/economics-of-money-banking-and-
financial-markets-global-11th-edition-mishkin-test-bank/
testbankfan.com
Childhood Voyages in Development 5th Edition Rathus Test
Bank
https://testbankfan.com/product/childhood-voyages-in-development-5th-
edition-rathus-test-bank/
testbankfan.com
Name:_______________________ CSCI 1302 OO Programming
Armstrong Atlantic State University
(50 minutes) Instructor: Y. Daniel Liang
Part I:
(A)
B’s constructor is invoked
A’s constructor is invoked
(B)
(a) The program has a syntax error because x does not have the compareTo
method.
(b) The program has a syntax error because the member access operator (.) is
executed before the casting operator.
(C)
(1) false
(2) true
(3) false (because they are created at different times)
(4) true
(E) The method throws a checked exception. You have to declare to throw
the exception in the method header.
Part II:
1
return result;
}
a. private method
b. protected method
c. public method
d. a and c
e. b and c
Key:e
2
#
2. Show the output of running the class Test in the following code:
interface A {
void print();
}
class C {}
a. Nothing.
b. b is an instance of A.
c. b is an instance of C.
d. b is an instance of A followed by b is an instance of C.
Key:d
#
3. When you implement a method that is defined in a superclass, you
__________ the original method.
a. overload
b. override
c. copy
d. call
Key:b
#
4. What is the output of running the class C.
public class C {
public static void main(String[] args) {
Object[] o = {new A(), new B()};
System.out.print(o[0]);
System.out.print(o[1]);
}
}
class A extends B {
public String toString() {
return "A";
}
}
3
class B {
public String toString() {
return "B";
}
}
a. AB
b. BA
c. AA
d. BB
e. None of above
Key:a
#
5. What is the output of running class C?
class A {
public A() {
System.out.println(
"The default constructor of A is invoked");
}
}
class B extends A {
public B(String s) {
System.out.println(s);
}
}
public class C {
public static void main(String[] args) {
B b = new B("The constructor of B is invoked");
}
}
a. none
b. "The constructor of B is invoked"
c. "The default constructor of A is invoked" "The constructor of B
is invoked"
d. "The default constructor of A is invoked"
Key:c
#
6. Analyze the following code:
a. The program has a syntax error because Test1 does not have a main
method.
4
b. The program has a syntax error because o1 is an Object instance
and it does not have the compareTo method.
c. The program has a syntax error because you cannot cast an Object
instance o1 into Comparable.
d. The program would compile if ((Comparable)o1.compareTo(o2) >= 0)
is replaced by (((Comparable)o1).compareTo(o2) >= 0).
e. b and d are both correct.
Key:e
#
7. The method _____ overrides the following method:
#
8. Which of the following possible modifications will fix the errors in
this code?
#
9. Analyze the following code.
class Test {
public static void main(String[] args) {
Object x = new Integer(2);
System.out.println(x.toString());
}
}
5
Key:c
#
10. What exception type does the following program throw?
public class Test {
public static void main(String[] args) {
Object o = new Object();
String d = (String)o;
}
}
a. ArithmeticException
b. No exception
c. StringIndexOutOfBoundsException
d. ArrayIndexOutOfBoundsException
e. ClassCastException
Key:e
#
11. What exception type does the following program throw?
public class Test {
public static void main(String[] args) {
Object o = null;
System.out.println(o.toString());
}
}
a. ArrayIndexOutOfBoundsException
b. ClassCastException
c. NullPointerException
d. ArithmeticException
e. StringIndexOutOfBoundsException
Key:c
6
Other documents randomly have
different content
From the foundation of astronomical science long ago,
innumerable [and] repeated observations of both ancient and
modern astronomers, emerged at last from their hiding places.
Made light of by the jests of so many outstanding intellects, they
have so successfully brought to light the paths of the stars and
their motions, which are more complicated to us than the Gordian
knots. Now it is possible for even an amateur in astronomy,
sufficiently instructed, to predict for any given time not only the
mean position of the planets, but also their true longitude and
latitude, and even the true time of their conjunctions, and their
ecliptic oppositions, with all the attendant circumstances. Yet,
until now, no hypothesis has been devised which would force an
automaton to show to us, before our very eyes, the eclipses of
the planets in their true and certain times.
For though there have been men seeking with all their might
to bind by laws their artificial heavens, by I know not how many
and how great calculations, and to systematize the complexities of
the rotations of celestial bodies; nevertheless, all of them, as if by
common agreement, considered themselves to have made great
contributions to mechanico-theoretical astronomy. However, they
have only attained, even though closely, the mean locations of the
secondary mobiles, and those by a certain rather crude
calculation. Some attained by more, some by less, but all by some
degree of wandering from the truth, either worn out by the
intricacies of the motions, or deceived and deceiving by the errors
of their calculations. This fact those well know, who, setting about
to collect information of this kind, even those publicized not long
ago, with true astronomical calculation, have been bored to death
while digging out by the most elementary and superficial
arithmetical torture, the worst of fallacies spontaneously erupting
from thence.
It would seem that true calculations alone can be desired in
mechanico-astronomics. Long study had not only convinced me
that an automaton was within the realm of possibility, but that
there were many mechanical systems by which it could be
achieved. I girded myself for a new project and developed it
theoretically from the ground up, but under such unhappy
auspices that not only did all hope fail that anyone would ever
appear who might have seemed willing to set his hand to the
work, but that the new discovery itself was scoffed at by many as
altogether a nightmarish delirium of an unbridled imagination.
The first months of the project must have seemed like an inspired dream to the
two men, and then must have followed a period of hopeless depression. Bertolla
undoubtedly felt many times that the clock was an aspiration far beyond their
combined abilities and means, but the priest would not be thwarted in his ambition
and refused to abandon the project. He felt that it was a work that they were
destined to produce. Many times, he wrote, he chided and begged and shamed his
erstwhile partner into resuming the project where it had been last abandoned.
Little by little, the first clock began to take form. As each new difficulty was
encountered, the two men would go back over the notes and sketches to trace the
problem to its source. Often a new part of the mechanism would nullify another
which had thus far operated successfully, and a complete rearrangement would be
required.
Again and again, Bertolla threw up his hands in despair and begged Father
Borghesi to abandon the enterprise. He protested that he was not capable of
producing such a complicated mechanism; he had neither the tools nor the skill.
The priest wished to produce a clock such as the world had never seen before,
such as the greatest scientists and clockmakers of all time had never been able to
make. But Bertolla felt that he was only a provincial craftsman who could not hope
to surpass them all with only his simple tools and training.
In his book on the first clock, Novissima Ac Perpetua Astronomica…, Father
Borghesi wrote that when he had finally come within a few weeks of the embryo
stage in the development of his clock, he was faced with the problem of bolstering
the sagging enthusiasm of Bertolla. The clockmaker's original enthusiasm had
shown promise of great results, but as the days passed and the problems of the
multiplex and generally unfamiliar apparatus to be forged for the workings of the
automaton became more complex, his ardor decreased. Finally, Bertolla became so
discouraged by the scoffers and frustrated by the fact that the work was
insufficiently organized that Father Borghesi wrote that "it almost became a harder
task for me to bolster up by daily opportunity and importunity the failing patience
of the artisan, frightened away from the work already begun, than it was for me to
extract from the inner recesses of mathematics and astronomy, without light and
without a guide, the whole fabric of the machine itself!"
In spite of Bertolla's protests, Father Borghesi prevailed, reviving his friend's
interest once more until the two were deep in the project again. Months passed as
they worked together on the mechanism and it seemed as if they lived for no
other purpose. Inevitably, Bertolla's health began to suffer, undermined as it was
by the constant nervous tension, and he eventually became ill from mental strain.
He was forced to spend some time in bed, and for many weeks the subject of the
clock was not discussed. Bertolla's other work, by which he made his living,
suffered and it was several months before he was able to return to his little shop.
One year passed into another and the work progressed slowly. The first clock,
which easily should have been finished in less than a year, was not completed until
after three full years had passed. However, when the priest and the clockmaker
put the finishing touches to their great clock, the result surpassed the greatest
possible expectations, for it was truly a masterpiece. Not only did it illustrate the
ecliptic phenomena of the moon, the sun and earth occurring in their proper time,
as well as many other things, but it showed these operations as they succeeded in
proper order, taking place through the centuries.
With mutual feelings of great pride, the two friends surveyed the result of their
three years of endeavor. Bertolla realized that he had reached a point of maximum
achievement in his work. He probably felt that now he could relax again, that his
sleep would no longer be troubled by confused nightmares of wheels and gears
that did not mesh together. Time was to prove otherwise.
PUBLISHED DESCRIPTION OF THE FIRST CLOCK
Father Borghesi soon came to the conclusion that it would be desirable to have
a written description to explain the mechanism of the clock and its many
indicators. He thereupon wrote out the story of how the clock was made, the
reasons for embarking on the enterprise, the difficulties he had encountered, and
the success which had crowned his and Bertolla's mutual labors. Finally, he
described the operation of the clock's mechanism and the functions of its array of
indicators.
The little book was written in Latin and only a few copies were printed,
presumably at the priest's own expense, on a handpress by Giovanni Battista
Monauni, printer to the Bishop in Trent. The little volume was stated by
contemporary writers to have been published in 1763, although no date appears
on the title page. The title translated is, in part, The Most Recent, Perpetual
Astronomical Calendar Clock, Theoretical—Practical…. The work begins with an
introduction for the reader in which Father Borghesi stated that:
… the little work, which, as far as I was concerned could easily have been
finished in a year, was only completed after about three years. Fortunately,
however, it was so far beyond the expectations of most, that not only am I
able to foretell with certainty all the lunar ecliptic phenomena and the solar, or
rather terrestrial, phenomena, carefully worked out in their true periods,
among many other matters exhibited by the machine; but also, within a few
hours, I can exhibit by altogether tangible evidence to the skeptics and the
doubting those very same phenomena, occurring within the space of many
years, or even centuries, and succeeding one another in proper order, with
their many attendant circumstances. I was not much concerned about the
other eclipses, such as those of Mercury, Venus, and the other stars
wandering through the zodiac, or about the other solar eclipses from the
transit of Mercury or Venus, since they are altogether undiscernible to the
naked eye, and very few compilers of ephemerides wish them to be noted,
probably for the same reason.
Do not, however, expect, star-loving reader, that here anything at all that
you may wish can be drawn forth as from its source, for to demand this would
be almost the same as to seek to drain as from a cup all the vast knowledge
of the many arithmetical sciences from the narrow confines of one book. You
will understand how impossible that is when, through prolonged labor, you
have grown somewhat more mature in this kind of learning.
Wherefore, rather fully, and out of consideration for you, I have decided,
setting aside these prolixities, with completely synoptic brevity and with all
possible clarity to expound for you simply the proportion of the movements,
the description of the machine, and its usage. As a result, when you have
progressed a little in theoretical mechanics, you will not only be able to
reduce all these things to their astronomical principles, but you may find the
way more smoothly laid out for you even for perfecting the machine itself.
And, thus, you may be more effectively encouraged to a successful
conclusion. Let it be so now for you through the following 10 chapters!
THE INSCRIPTIONS
Figure 13.—Portrait of Francis I,
Beginning with the uppermost part of Emperor of the Holy Roman
Empire, to whom Father Borghesi's
the frontispiece, there are nine astronomical clock in the Museum
inscriptions in Latin on the dial plate. The of History and Technology appears
topmost is Franciscvs I sit plan. to have been inscribed.
Dominator aeternvs. The phrase has
reference to Francis I, who was Emperor of the Holy Roman Empire, from 1745-
1765, and husband of Empress Maria Theresa of Austria. The phrase may be
translated as "May Francis I be the eternal ruler by favor of the planets" or more
simply "Long Live Francis I, Emperor." [14] Although the dial plate of the Borghesi
clock is inscribed with his name, the records indicate that the clock was presented
to Maria Theresa. Francis I may have already died before the presentation was
made.
From the left to right over the tableau of the Holy Trinity is the phrase "Lavs
sacrosanctae Triadi Vni Deo, et Deiparae" (Praise [be] to the most Holy Trinity, to
the one God, and to the Mother of God).
Within the upper left and right spandrels is inscribed:
Isthaec, Signum grande apparvit in Coelo * sancta Dei genitrix amicta sole
* Illibato pede Lvnae et serpentis nigra premens Cornva * bis senis
pvlcherrime Coronata syderibvs * Tempe indesinenter clavsa, scatvrigo
signata * Cedrvs in Libano, Cypresvs in Monte Sion * Mater pvrae Dilectionis
sanctaeqve spei * Chara patris aeterni proles, Verbi Mater, sponsaqve
procedentis *, gratiae et gloriae circvmdata varietate.
This inscription is a eulogy to the Virgin Mary assembled from the texts of Holy
Scripture. In addition, each lemma, contained within asterisks, carries out the
chronogram 1764, the year the clock was completed. Each lemma is translated
and identified from the Douay-Rheims version of the Bible:
Figure 14.—The bottom right corner Figure 15.—The bottom left corner of
of the dial plate, showing two the dial plate, showing the
noblemen contemplating an orb, engraving of Atlas, with the
with the inscription "Diligit inscription "Assidvo proni donant di
Avdaces Trepidos Fortvna cvncta labori." (The favorable gods
Repellet." (Fortune favors the willingly grant all things to the
daring and rejects the timid.) assiduous laborer.)
At the lower left corner below the figure of Atlas upholding the world is the
phrase, Assidvo proni donant di cvncta labori. (The favorable gods willingly grant
all things to the assiduous laborer.) The same phrase is quoted by Father Borghesi
in the text of his second volume. The last inscription appears at the lower right
corner under the figures of the two noblemen, Diligit avdaces trepidos fortvna
repellet. (Fortune favors the daring and rejects the timid.) The last two inscriptions
are in dactylic hexameter. They appear to be original compositions inasmuch as no
classical prototypes have been identified.
Figure 17.—Movement of Borghesi clock viewed from the right side, with
details of chiming mechanism.
THE BELLS
There is a discrepancy between Father Borghesi's written description in his
second book of the number of bells and those which currently exist in the clock. At
the present time, there are two sets of bells attached to the upper part of the
movement. While Father Borghesi indicated that there were two sets of bells in the
clock, he described the first set by stating that:
… there are three bells inside the clock: The largest, when
struck by a little hammer at each mean new moon, signifies the
new moon. The smallest indicates in the same way the full moon
at the time of the mean full moon, by automatic sound. When on
the equatorial earth, the sun appears anywhere in eclipse, two
bells (the largest and the medium) sounding together
automatically, announce that eclipse at the time of the mean new
moon. (I think it is evident that eclipses of the sun occur at new
moons and eclipses of the moon at full moon.)
When the moon is eclipsed, the smallest and the medium
bells, simultaneously and automatically, announce the event to
the ear at the time of the mean full moon. Besides, at the proper
time and automatically, the largest of these bells announces the
current solar hour and the smallest bell strikes the quarter hours.
In the clock today, the first set consists of a smaller bell fixed within a larger
one. It is presumably these bells that indicate the eclipses and also strike the
hours and quarter hours. A pull cord attached to the striking mechanism repeats
the current hour and quarter hours at will. The second set consists of nine meshed
bells struck with individual hammers operated by means of a pinned cylinder as in
a music box. On the hour, the chimes play one of two melodies, which may be
changed at will. While not identified, these appear to be Tyrolean folk melodies.
The largest of this set of bells is dissimilar to the other chimes, and may be the
third bell described by Father Borghesi to signify the new moon.
CHRONOGRAMS
One of the most curious aspects of the second clock produced by Father
Borghesi and Bertolla, as well as of the second published volume, is the presence
of chronograms which occur repeatedly on the clock dial and throughout the
Novissimum Theorico-Practicum Astronomicum Authoma from the title page to the
end of the book. Interestingly enough, Father Borghesi did not utilize this device
even once in his first little book.
Figure 18.—A chronogram in the text of Father Borghesi's second
volume, indicating the year 1764. The poem is translated as: "In the
Mount of 'Anáuni,' the inscrutable heavens are led, You learn from
these all the labors of the sun and the moon. Here you are shown and
hear the conjunction of the moon: And a bell brings to the ears by its
sound, all eclipses."
L V C C I D I V I D D I
The third inscription required a little more planning, because of its greater
length. Accordingly, Father Borghesi divided it into nine parts, each of which is
separated from the other by means of asterisks. Each of the nine parts of the
inscription formed a chronogram which, in every instance, totals to the date 1764,
the year in which the second clock was completed. The same procedure was
followed with the inscriptions in the lower left and the lower right corners of the
dial as well as with the maker's inscription within the central disk. This inscription
is
BVrghesIo DoCtore, et BertoLLa LIMatore AnnanIensIbVs
V I D C L L L I M I I V
The inscriptions within the chapter ring are not utilized for chronograms,
however. It is apparent that Father Borghesi was required to make a most careful
selection of the texts for his inscriptions in order that none of the phrases included
any additional letters which formed Roman numerals than would total to the date
he desired to indicate, namely, 1764. Where it was necessary, he employed an
asterisk to separate parts of texts so that each would produce the same total. Any
letter that did not form a Roman numeral, even if capitalized or used in a larger
size, did not interfere with the formation of the chronograms.
In spite of his ingenuity in designing a text which would include only such of
the letters representing the Roman numerals which would provide the
chronograms for 1764, Father Borghesi experienced some difficulties, particularly
in place names. He accordingly changed them in order to avoid the inclusion of
letters that would have disturbed his totals. Examples are MEGGL instead of
MECHL, which had an extra C, and RVNNO instead of RVMO, which had an extra
M.