Starting Out with Java From Control Structures through Objects 6th Edition Gaddis Test Bankinstant download
Starting Out with Java From Control Structures through Objects 6th Edition Gaddis Test Bankinstant download
http://testbankbell.com/product/starting-out-with-java-from-
control-structures-through-objects-6th-edition-gaddis-test-bank/
http://testbankbell.com/product/solution-manual-for-starting-out-with-
java-from-control-structures-through-objects-5-e-5th-
edition-0132989999/
http://testbankbell.com/product/solution-manual-for-starting-out-with-
c-from-control-structures-to-objects-9th-edition-tony-gaddis/
http://testbankbell.com/product/solution-manual-for-starting-out-with-
c-from-control-structures-through-objects-7-e-7th-edition-0132774178/
http://testbankbell.com/product/test-bank-for-human-biology-10th-
edition-starr/
Computational Materials Science An Introduction 1st Lee
Solution Manual
http://testbankbell.com/product/computational-materials-science-an-
introduction-1st-lee-solution-manual/
http://testbankbell.com/product/test-bank-for-sociology-11th-edition-
shepard/
http://testbankbell.com/product/solution-manual-for-connect-with-
smartbook-online-access-for-managerial-accounting-11th-edition/
http://testbankbell.com/product/children-and-their-development-
kail-7th-edition-test-bank/
Solution Manual for Macroeconomics Principles and Policy,
12th Edition
http://testbankbell.com/product/solution-manual-for-macroeconomics-
principles-and-policy-12th-edition/
Gaddis: Starting Out with Java: From Control Structures through Objects, 6/e © 2016 Pearson Education
Chapter 2
MULTIPLE CHOICE
1. Which one of the following would contain the translated Java byte code for a program named Demo?
a. Demo.java
b. Demo.code
c. Demo.class
d. Demo.byte
ANS: C
ANS: C
ANS: A
ANS: A
5. The term typically refers to the device that displays console output.
a. Standard output device
b. Central processing unit
c. Secondary storage device
d. Liquid crystal display
ANS: A
ANS: A
ANS: D
ANS: A
ANS: B
ANS: D
11. Which of the following is not a rule that must be followed when naming identifiers?
Gaddis: Starting Out with Java: From Control Structures through Objects, 6/e © 2016 Pearson Education
a. The first character must be one of the letters a-z, A-Z, and underscore or a dollar sign.
b. Identifiers can contain spaces.
c. Uppercase and lowercase characters are distinct.
d. After the first character, you may use the letters a-z, A-Z, the underscore, a dollar sign, or digits 0-
9.
ANS: B
ANS: C
ANS: A
ANS: D
b. float y;
double z;
z = 934.21;
y = z;
c. float w;
w = 1.0f;
d. float v;
v = 1.0;
ANS: C
16. The boolean data type may contain values in the following range of values
a. true or false
Gaddis: Starting Out with Java: From Control Structures through Objects, 6/e © 2016 Pearson Education
b. -128 to + 127
c. - 2,147,483,648 to +2,147,483,647
d. - 32,768 to +32,767
ANS: A
ANS: C
10 + 5 * 3 - 20
a. -5
b. 5
c. 25
d. -50
ANS: B
25 / 4 + 4 * 10 % 3
a. 19
b. 5.25
c. 3
d. 7
ANS: D
int x = 5, y = 20;
x += 32;
y /= 4;
System.out.println("x = " + x + ", y = " + y);
a. x = 32, y = 4
b. x = 9, y = 52
c. x = 37, y = 5
d. x = 160, y = 80
ANS: C
21. What will be the value of z as a result of executing the following code?
Gaddis: Starting Out with Java: From Control Structures through Objects, 6/e © 2016 Pearson Education
int x = 5, y = 28;
float z;
z = (float) (y / x);
a. 5.60
b. 5.6
c. 3.0
d. 5.0
ANS: D
22. What will be the displayed when the following code is executed?
a. x = 22, y = 4
b. x = 22, y = 26
c. x = 22, y = 88
d. Nothing, this is an error
ANS: D
23. In the following Java statement what value is stored in the variable name?
a. John Doe
b. The memory address where "John Doe" is located
c. name
d. The memory address where name is located
ANS: B
int x = 6;
String msg = "I am enjoying this class.";
String msg1 = msg.toUpperCase();
String msg2 = msg.toLowerCase();
char ltr = msg.charAt(x);
int strSize = msg.length();
System.out.println(msg);
System.out.println(msg1);
System.out.println(msg2);
System.out.println("Character at index x = " +
ltr);
System.out.println("msg has " + strSize +
"characters.");
ANS: D
a. 9
45
16
b. 94516
c. 9 45 16
d. Nothing, this is an error
ANS: D
ANS: C
ANS: D
ANS: B
29. To print "Hello, world" on the monitor, use the following Java statement
a. SystemOutPrintln("Hello, world");
b. System.out.println{"Hello, world"}
c. System.out.println("Hello, world");
d. Print "Hello, world";
ANS: C
30. To display the output on the next line, you can use the println method or use this escape sequence in the
print method.
a. \n
b. \r
c. \t
d. \b
ANS: A
ANS: C
int x = 578;
System.out.print("There are " +
x + 5 + "\n" +
"hens in the hen house.");
ANS: D
ANS: B
34. The primitive data types only allow a(n) to hold a single value.
a. variable
b. object
c. class
d. literal
ANS: A
35. If x has been declared an int, which of the following statements is invalid?
a. x = 0;
b. x = -58932;
c. x = 1,000;
d. x = 592;
ANS: C
36. Given the declaration double r;, which of the following statements is invalid?
a. r = 326.75;
b. r = 9.4632e15;
c. r = 9.4632E15;
d. r = 2.9X106;
ANS: D
ANS: B
25 - 7 * 3 + 12 / 3
Gaddis: Starting Out with Java: From Control Structures through Objects, 6/e © 2016 Pearson Education
a. 6
b. 8
c. 10
d. 12
ANS: B
17 % 3 * 2 - 12 + 15
a. 7 b.
8 c.
12
d. 105
ANS: A
40. What will be displayed after the following statements have been executed?
a. x = 27, y = 3.333, z = 18
b. x = 27, y = 2, z = 18
c. x = 27, y = 3, z = 18
d. x = 37, y = 14, z = 4
ANS: C
41. What will be the value of z after the following statements have been executed?
int x = 4, y = 33;
double z;
z = (double) (y / x);
a. 8.25
b. 4
c. 8
d. 8.0
ANS: D
42. This is a variable whose content is read only and cannot be changed during the program's execution.
a. operator
b. literal
c. named constant
Visit https://testbankbell.com
now to explore a rich
collection of testbank,
solution manual and enjoy
exciting offers!
Gaddis: Starting Out with Java: From Control Structures through Objects, 6/e © 2016 Pearson Education
d. reserved word
ANS: C
43. What will be displayed after the following statements have been executed?
a. x = 54.3
b. x = 99
c. x = 153.3
d. Nothing, this is an error.
ANS: D
ANS: D
int x = 8;
String msg = "I am enjoying java.";
String msg1 = msg.toUpperCase();
String msg2 = msg.toLowerCase();
char ltr = msg.charAt(x);
int strSize = msg.length();
System.out.println(msg);
System.out.println(msg1);
System.out.println(msg2);
System.out.println("Character at index x = " +
ltr);
System.out.println("msg has " + strSize +
" characters.");
a. I am enjoying java.
I AM ENJOYING JAVA.
i am enjoying java.
Character at index x = j
msg has 20 characters.
b. I am enjoying java.
I AM ENJOYING JAVA.
i am enjoying java.
Character at index x = o
msg has 20 characters.
c. I am enjoying java.
Gaddis: Starting Out with Java: From Control Structures through Objects, 6/e © 2016 Pearson Education
I AM ENJOYING JAVA.
i am enjoying java.
Character at index x = o
msg has 19 characters.
d. I am enjoying java.
I AM ENJOYING JAVA.
i am enjoying java.
Character at index x = y
msg has 19 characters.
ANS: C
46. Which of the following does not describe a valid comment in Java?
a. Single line comments, two forward slashes - //
b. Multi-line comments, start with /* and end with */
c. Multi-line comments, start with */ and end with /*
d. Documentation comments, any comments starting with /** and ending with */
ANS: C
47. Which of the following statements correctly creates a Scanner object for keyboard input?
b. Scanner keyboard(System.in);
ANS: C
a. readInt() c. getInt()
b. nextInt() d. read_int()
ANS: B
a. readString() c. getString()
b. nextString() d. nextLine()
ANS: D
50. Which one of the following methods would you use to convert a string to a double?
a. Byte.ParseByte c. Integer.ParseInt
b. Long.ParseLong d. Double.ParseDouble
Gaddis: Starting Out with Java: From Control Structures through Objects, 6/e © 2016 Pearson Education
ANS: D
TRUE/FALSE
1. A Java program will not compile unless it contains the correct line numbers.
ANS: F
ANS: F
ANS: F
4. Although the dollar sign is a legal identifier character, you should not use it because it is normally used for
special purposes.
ANS: T
5. Assuming that pay has been declared a double, the following statement is valid.
pay = 2,583.44;
ANS: F
6. Named constants are initialized with a value, that value cannot be changed during the execution of the program.
ANS: T
7. A variable's scope is the part of the program that has access to the variable.
ANS: T
8. In Java the variable named total is the same as the variable named Total.
ANS: F
ANS: F
10. Both character literals and string literals can be assigned to a char variable.
ANS: F
11. If the compiler encounters a statement that uses a variable before the variable is declared, an error will result.
ANS: T
12. Programming style includes techniques for consistently putting spaces and indentation in a program so visual
cues are created.
ANS: T
Exploring the Variety of Random
Documents with Different Content
The Project Gutenberg eBook of Tom Burnaby:
A Story of Uganda and the Great Congo Forest
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.
Language: English
Produced by Al Haines.
Cover
A Warm Reception. (See page 46.)
TOM BURNABY
A STORY OF
UGANDA AND THE GREAT CONGO FOREST
BY
HERBERT STRANG
NEW EDITION
HUMPHREY MILFORD
OXFORD UNIVERSITY PRESS
LONDON, EDINBURGH, GLASGOW
TORONTO, MELBOURNE, CAPE TOWN, BOMBAY
REPRINTED 1922 IN GREAT BRITAIN
BY MORRISON AND GIBB LTD., EDINBURGH
MY DEAR JACK,
Your birthday has come round again--and here, with every good
wish, is another book for your shelf. No mailed knights this time; our
story is of the present day. Yet you shall find paynim hordes as many
and as fierce as you please; yes, and chivalry itself, or I am much
mistaken,--although we may not spell it with a capital C. For it is a
theory of mine--"Old Uncle and his theories!" I hear you say!--that
the spirit of chivalry is as much alive to-day as ever, and finds as free
a scope. And if chivalry is, as I take it to be, the championing of the
weak and the oppressed, no region of the world offers a wider field
than Central Africa, where there is still ample work for the
countrymen of Livingstone and Gordon. Some day, perhaps, you
may yourself visit that land, and come back with as deep a sense of
its glamour and pathos as the rest of us. Meanwhile, since even at
Harrow the sky is not always clear, why not on some rainy afternoon
pack up your traps and transport yourself in imagination to Uganda
with Tom Burnaby? If you return with a certain stock of information
about the land and its people--well, your old uncle will be all the
better pleased. Not, of course, that this trip should be a reason for
neglecting your football--or other duties!
Your affectionate uncle,
HERBERT STRANG.
Contents
KABAMBARI
CHAPTER I
FITTING OUT AN EXPEDITION
CHAPTER II
MBUTU
CHAPTER III
ON THE VICTORIA NYANZA
CHAPTER IV
A STERN CHASE
CHAPTER V
A LONG MARCH
CHAPTER VI
UNMASKED
CHAPTER VII
AMBUSCADING AN AMBUSH
CHAPTER VIII
IN THE TOILS
CHAPTER IX
GONE AWAY!
CHAPTER X
THE LAND OF THE PIGMIES
CHAPTER XI
THE VALLEY OF THE SHADOW
CHAPTER XII
BIG MEDICINE
CHAPTER XIII
BLOOD-BROTHERHOOD
CHAPTER XIV
THE SIEGE OF BAREGA'S
CHAPTER XV
ARMS AND THE MAN
CHAPTER XVI
THE MAKING OF AN ARMY
CHAPTER XVII
TREACHERY
CHAPTER XVIII
THE GREAT FIGHT
CHAPTER XIX
TOM'S ARMADA
CHAPTER XX
AN END AND A BEGINNING
ZANZIBAR
Illustrations
PLATE I
A WARM RECEPTION . . . . . . Frontispiece
PLATE II
A MÊLÉE IN THE FOREST
PLATE III
TOM SURPRISES MABRUKI
PLATE IV
TOM IN THE BREACH
PLATE V
THE FIGHT ON THE LAKE
Plans
PLAN I
THE BATTLE OF IMUBINGA
PLAN II
BAREGA'S VILLAGE DURING THE SIEGE
PLAN III
THE GREAT FIGHT BY THE SWAMP
KABAMBARI
A belt of matted woodland. At the edge, three Belgian officers, in
light uniform and white topee, lying prone, and peering cautiously
out through glasses. Before them, a wide clearing, with a mud-
walled town in the midst, and huge forest-trees beyond. Behind, a
few score stalwart Bangala, strewn panting on the ground. Over all,
the swarming sunlit haze of tropical Africa.
The gates stand open; peace reigns in Kabambari. But what is
peace in Kabambari? Some hundreds of negro slaves are tilling
sorghum in the cultivated tract outside the stockaded walls. Their
chains clank as they move heavily down the field, dogged by an
Arab overseer armed with rifle, scimitar, and whip. The pitiless sun,
scorching their bent backs, blackens the scars left by the more
pitiless scourge.
In the copse there is a whispered word of command; the negro
soldiers spring silently to their feet, line up as best the broken
ground permits, and then, at the heels of their white officers, charge
out into the sunlight. No yell nor cheer, as they dash towards the
open gate; the overseer, ere he can give the alarm, is bayoneted
while his finger is on the trigger; the slaves, listless, apathetic, have
scarcely time to realize their taskmaster's doom before the thin line
has swept past them and through the gates. Then there is a sudden
sharp crackle of musketry; cries of startled fear and savage triumph;
and by ones and twos and threes, turbaned figures pour out of the
far side of the town, a scanty remnant of the Arab garrison. One by
one they drop as they cross the open; only a few gain the shelter of
the forest. The heirs of Tippu Tib are broken and dispersed. The
struggle has been long, the issue doubtful; but now, after years of
stern fighting, the great Arab empire, founded upon murder, rapine,
and slavery, is scattered to the winds. One thing only is wanting to
make this last victory complete. Rumaliza, the Arab commander,
Tippu Tib's ablest lieutenant, has escaped the net. Whether to live
and build anew the dread fabric raised by his late chief; or whether
to die in the gloomy depths of the Great Forest by starvation or
disease, or by the poisoned arrow of the Bambute--who can say?
CHAPTER I: Fitting Out an Expedition
testbankbell.com