Test Bank For Starting Out With Java From Control Structures Through Data Structures 3rd Edition 0134038177 9780134038179 Download
Test Bank For Starting Out With Java From Control Structures Through Data Structures 3rd Edition 0134038177 9780134038179 Download
http://testbankpack.com/download/test-bank-for-starting-out-with-
java-from-control-structures-through-data-structures-3rd-
edition-0134038177-9780134038179/
https://testbankpack.com/download/test-bank-for-data-structures-and-
abstractions-with-java-4th-edition-by-carrano-henry-
isbn-0133744051-9780133744057/
Test Bank for Starting Out with Python 3rd Edition Gaddis
0133582736 9780133582734
https://testbankpack.com/download/test-bank-for-starting-out-with-
python-3rd-edition-gaddis-0133582736-9780133582734/
Test Bank for Starting Out with Java From Control Structures
through Data Structures 3rd Edition 0134038177 9780134038179
Full link download
Test Bank
https://testbankpack.com/p/test-bank-for-starting-out-with-java-from-
control-structures-through-data-structures-3rd-edition-0134038177-
9780134038179/
Starting Out with Java: From Control Structures through Data Structures 3e (Gaddis and Muganda)
Chapter 2 Java Fundamentals
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
Answer: C
5) The term typically refers to the device that displays console output.
A) standard output device
B) central processing unit
C) secondary storage device
1
Copyright © 2016 Pearson Education, Inc.
D) liquid crystal display
Answer: A
2
Copyright © 2016 Pearson Education, Inc.
7) If the following Java statements are executed, what will be displayed?
3
Copyright © 2016 Pearson Education, Inc.
11) Which of the following is NOT a rule that must be followed when naming identifiers?
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.
Answer: B
16) The boolean data type may contain values in the following range of values:
A) true or false
B) -128 to + 127
C) - 2,147,483,648 to +2,147,483,647
D) - 32,768 to +32,767
Answer: A
4
Copyright © 2016 Pearson Education, Inc.
17) Character literals are enclosed in ; string literals are enclosed in .
A) single quotes; single quotes
B) double quotes; double quotes
C) single quotes; double quotes
D) double quotes; single quotes
Answer: C
10 + 5 * 3 - 20
A) -5
B) 5
C) 25
D) -50
Answer: B
25 / 4 + 4 * 10 % 3
A) 19
B) 5.25
C) 3
D) 7
Answer: 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
Answer: C
21) What will be the value of z as a result of executing the following code?
int x = 5, y = 28;
float z;
z = (float) (y / x);
A) 5.60
B) 5.6
C) 3.0
D) 5.0
Answer: D
5
Copyright © 2016 Pearson Education, Inc.
22) What will be the displayed when the following code is executed?
23) In the following Java statement what value is stored in the variable name?
6
Copyright © 2016 Pearson Education, Inc.
24) What will be displayed as a result of executing the following code?
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.");
A) I am enjoying this class.
I AM ENJOYING THIS CLASS.
i am enjoying this class.
Character at index x = e
msg has 24 characters.
B) I am enjoying this class.
I AM ENJOYING THIS CLASS.
i am enjoying this class.
Character at index x = e
msg has 25 characters.
C) I am enjoying this class.
I AM ENJOYING THIS CLASS.
i am enjoying this class.
Character at index x = n
msg has 24 characters.
D) I am enjoying this class.
I AM ENJOYING THIS CLASS.
i am enjoying this class.
Character at index x = n
msg has 25characters.
Answer: D
7
Copyright © 2016 Pearson Education, Inc.
25) What will be displayed as a result of executing the following code?
27) When saving a Java source file, save it with an extension of:
A) .javac
B) .class
C) .src
D) .java
Answer: D
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";
Answer: C
8
Copyright © 2016 Pearson Education, Inc.
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
Answer: A
int x = 578;
System.out.print("There are " +
x + 5 + "\n" +
"hens in the hen house.");
A) There are 583 hens in the hen house.
B) There are 5785 hens in the hen house.
C) There are x5\nhens in the hen house.
D) There are 5785
hens in the hen house.
Answer: D
34) The primitive data types only allow a(n) to hold a single value.
A) variable
B) object
C) class D)
literal
Answer: 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;
Answer: C
9
Copyright © 2016 Pearson Education, Inc.
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;
Answer: D
25 - 7 * 3 + 12 / 3
A) 6
B) 8
C) 10
D) 12
Answer: B
17 % 3 * 2 - 12 + 15
A) 7
B) 8
C) 12
D) 105
Answer: A
40) What will be displayed after the following statements have been executed?
10
Copyright © 2016 Pearson Education, Inc.
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
Answer: 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
D) reserved word
Answer: C
43) What will be displayed after the following statements have been executed?
A) x = 54.3
B) x
C) x = 108.6
D) Nothing, this is an error.
Answer: D
11
Copyright © 2016 Pearson Education, Inc.
45) What will be displayed as a result of executing the following code?
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.
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.
Answer: 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 */
Answer: C
47) Which of the following statements correctly creates a Scanner object for keyboard input?
A) Scanner kbd = new Scanner(System.keyboard);
B) Scanner keyboard(System.in);
C) Scanner keyboard = new Scanner(System.in);
D) Keyboard scanner = new Keyboard(System.in);
Answer: C
12
Copyright © 2016 Pearson Education, Inc.
Exploring the Variety of Random
Documents with Different Content
Tsin, y por tanto en el siglo iii de nuestra era, gobernaban los
chinos sus barcos con arreglo á las indicaciones magnéticas. En el
Tchinlafungthuki, ó descripción del país de Cambodja, obra
publicada recientemente en París, pero escrita en 1297 en el
reinado del Khan Timur, las rutas ó direcciones de la navegación
están siempre indicadas con arreglo á los rumbos de la brújula.
El uso de la aguja imantada lo introdujeron en Europa los árabes,
como lo prueban las denominaciones de zohron y aphron (Sur y
Norte), dadas en el Speculum naturale de Vicente de Beauvais á
los dos polos del imán. (El Libro de las piedras, que los árabes
atribuyeron á Aristóteles y cita Alberto el Grande «como prueba
del uso del imán en la marina», es apócrifo y acaso de la misma
época que el tratado árabe de las piedras de Teïfachi y Beilak
Kiptchaki.) Los primeros que en Europa hablaron de la brújula,
pero en el sentido de ser su uso conocido, como instrumento
necesario á los marinos, fueron Guyot de Provins en un poema
político satírico titulado La Biblia, compuesto en 1190, y el obispo
de Ptolemaïs, Jacobo de Vitry, en su Descripción de Palestina,
escrita entre 1204 y 1215.
La prueba que ha querido M. Hansteen deducir del Landnamebok
para suponer que los noruegos usaron la brújula en el siglo xi,
queda anulada por las investigaciones de M. Kämtz (Klapr.,
páginas 41, 45, 50, 66, 90 y 97).
Las obras del célebre mallorquín Raimundo Lulio (por ejemplo, su
tratado De contemplatione, escrito en 1272, cap. cxxix, § 19, y
cap. ccxci, § 17) y el texto de antiguas leyes españolas prueban
que á mediados del siglo xiii los marinos catalanes y vascos
usaban comunmente la brújula (Capmany, Cuestiones críticas,
1807, Cuestión 2.ª, pág. 38; y Comercio antiguo de Barcelona, t.
iii, páginas 72-74).
Theofrasto distingue muy bien el fucus del litoral del fucus de alta
mar. Aristóteles, en las Meteorológicas, insiste en la ausencia del
viento, idea sistemática muy generalizada y verdaderamente
extraña tratándose de un mar tan frecuentemente agitado como
lo es el que media entre Gades y las Islas Afortunadas, de una
región que no es por cierto el golfo de las Damas de los pilotos
castellanos. He aquí lo que el Stagirita añade después de haber
disertado acerca de la relación que supone existir entre la
dirección de las corrientes y el declive del fondo del mar: τὰ δ’
ἔξω στηλῶν βραχέα μὲν διὰ τὸν πηλόν, ἄπνοα δ’ ἐστὶν ὡς ἔν
κοίλῳ θαλάττης οὔσης. El poeta orphico (Argonaut., v, 1.107,
edic. Lips., 1818), al cantar los trabajos de los Argonautas que,
llegados á las regiones del Norte, viéronse precisados á arrastrar
el buque Argos con cuerdas, añade que un aire impetuoso no
levanta allí más que su aliento un mar privado de vientos de
tempestad; que la ola, último límite del imperio de Thetys, es
muda bajo el helado carro de la Osa. «Las razas hiperbóreas
llaman (v. 1.085) á estas aguas el Mar Muerto» (Voy., t. i, pág.
196 y siguientes). La astucia de los fenicios, el deseo de un
pueblo comercial de apartar á sus rivales de toda navegación más
allá de las Columnas, ¿fueron acaso los motivos de propagar estas
ilusiones de la falta absoluta de tempestades? ¿O la calma que
reina en las regiones boreales durante las grandes nieblas (el
pulmón marino de Pytheas, Strabón, ii, pág. 104 Cas.), y la idea
que los obstáculos que el fucus opone al movimiento de las olas
influyeron en las creencias populares? Rutilio (Itinerar., lib. i, v.
537, Poët. lat. min., volumen iv, pág. 151) describe «las algas que
ante el puerto de Pisa amortiguaban las olas», y Avieno (Ora
marit., v. 406) extiende este fenómeno á todo el Atlántico:
Plerumque porro tenue tenditur salum,
Ut vix arenas subjacentes occulat,
Exuperat autem gurgitem fucus frequens,
Atque impeditur æstur hic uligine.
Casi sorprende que una isla cuyo suelo oscila sin cesar no esté
dedicada á Neptuno, como también su tamaño de mil estadios
que menciona Proclo; pero repito que en el pasaje de Avieno la
localidad es muy vaga, y paréceme que lo dicho por él conduce
por las islas Oestrymnienas ó Cassitérides y por Ophiusa, cerca de
las costas septentrionales de Iberia (Uckert, Geogr. der Griechen,
t. ii, 2, pág. 477), hacia el Noroeste, al Mar Cronieco y hacia el
gran continente Saturniano de Plutarco.
En cuanto al conocimiento que los antiguos tenían de las islas
Afortunadas, haré notar aquí que los amnes Siluris piscibus
abundantes de Plinio, Solino y Dicuil, se explican quizá por un
hecho cuya primera noticia debo á un naturalista que ha habitado
largo tiempo en la isla de Tenerife. Mr. Berthelot asegura que
«desde tiempo inmemorial hay en Tenerife anguilas iguales á las
de Europa; que le aseguraban las había también en las islas de
Palma y de la Gran Canaria, y que se puede presumir su
existencia en todo el archipiélago. En Tenerife abundan
principalmente las anguilas en el barranco de Goyonxé, situado en
la costa septentrional, y en el distrito de Tacoronte». Mr. Berthelot
ha pescado gran número en este sitio, en unión de los monjes de
Santo Domingo, y ha visto también muchas en los barrancos
inmediatos al puerto de Santa Cruz de Tenerife. En el invierno,
cuando las lluvias aumentan las aguas de los torrentes y éstos se
abren impetuosamente cauces por el suelo, las anguilas
disminuyen, y es probable que se refugien en quebraduras más
profundas del terreno; pero durante el verano, cuando el lecho
del torrente queda en seco, se las encuentra muy gruesas en los
charcos de agua cenagosa que quedan en el fondo de los
barrancos. Acaso estas anguilas han sido confundidas con los
siluros. La existencia de peces en una isla completamente
volcánica y muy árida es un fenómeno curiosísimo. Sabido es,
además, que las anguilas pueden vivir largo tiempo en el fango y
en la hierba húmeda, y que, según mis experimentos, inspiran y
descomponen, fuera del agua, mucho aire atmosférico en estado
elástico.
[81] En 1455, y no en 1504 como se encuentra en la traducción
latina del viaje de Cadamosto, publicada por Grynæus, Nov. Orbis
(1555, pág. 2). Este error, que tiene alguna importancia por lo
que interesa la historia del volcán de Tenerife, ha sido copiado en
mi Rélation historique, t. i, pág. 174, y en otras obras. En esta
misma edición Grynæus hormiguean los errores de cifras; al
Baobal Adansonia digitata, medido por Cadamosto, sólo le da 17
pies de circunferencia, en vez de diez y siete brazas. El primer
viaje de Cadamosto, que se unió en las desembocadura del
Senegal con Antoniotto Usodimare, y del cual no hace Barros
mención alguna en sus Décadas, comenzó en 1454, y el segundo
en 1456. Cadamosto no volvió de Portugal á Venecia hasta 1463.
La relación de sus expediciones apareció en 1507 en la primera
de todas las colecciones de viajes, que fué impresa en 1507 en
Vicenza, y en 1508 en Milán con el título de Mondo Novo, opera di
Francazio di Monte Alboddo. Cadamosto no descubrió ni las islas
de Cabo Verde ni el Cabo de este nombre. El primero de estos
descubrimientos se hizo en 1441 y corresponde á dos genoveses,
Antonio y Bartolomé Nolle; el segundo es de Dionisio Fernández
(Tiraboschi, t. vi, parte i, pág. 169). Cuando Cadamosto visitó en
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
testbankpack.com