Test Bank for Starting Out with Java From Control Structures through Data Structures 3rd Edition 0134038177 9780134038179 2024 scribd download full chapters
Test Bank for Starting Out with Java From Control Structures through Data Structures 3rd Edition 0134038177 9780134038179 2024 scribd download full chapters
http://testbankpack.com/download/solution-manual-for-international-
trade-4th-edition-feenstra-taylor-1319061737-9781319061739/
testbankpack.com
Solution Manual for Chemistry A Molecular Approach 3rd
Edition by Tro ISBN 0321809246 9780321809247
http://testbankpack.com/download/solution-manual-for-chemistry-a-
molecular-approach-3rd-edition-by-tro-isbn-0321809246-9780321809247/
testbankpack.com
http://testbankpack.com/download/solution-manual-for-calculus-8th-
edition-by-stewart-isbn-1285740629-9781285740621/
testbankpack.com
http://testbankpack.com/download/test-bank-for-general-chemistry-
atoms-first-2nd-edition-by-mcmurry-fay-isbn-0321809262-9780321809261/
testbankpack.com
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.
Visit https://ebookmass.com
now to explore a rich
collection of eBooks and enjoy
exciting offers!
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.
48) Which Scanner class method reads an int?
A) readInt()
B) nextInt()
C) getInt()
D) read_int()
Answer: B
50) Which one of the following methods would you use to convert a string to a double?
A) Byte.ParseByte
B) Long.ParseLong
C) Integer.ParseInt
D) Double.ParseDouble
Answer: D
1) A Java program will not compile unless it contains the correct line numbers.
Answer: FALSE
4) Although the dollar sign is a legal identifier character, you should not use it because it is normally used
for special purposes.
Answer: TRUE
5) Assuming that pay has been declared a double, the following statement is valid.
pay = 2,583.44;
Answer: FALSE
6) Named constants are initialized with a value, that value cannot be changed during the execution of the
program.
Answer: TRUE
7) A variable's scope is the part of the program that has access to the variable.
Answer: TRUE
8) In Java the variable named total is the same as the variable named Total.
Answer: FALSE
13
Copyright © 2016 Pearson Education, Inc.
9) Class names and key words are examples of variables.
Answer: FALSE
10) Both character literals and string literals can be assigned to a char variable.
Answer: FALSE
11) If the compiler encounters a statement that uses a variable before the variable is declared, an error will
result.
Answer: TRUE
12) Programming style includes techniques for consistently putting spaces and indentation in a program
so visual cues are created.
Answer: TRUE
14
Copyright © 2016 Pearson Education, Inc.
Random documents with unrelated
content Scribd suggests to you:
The Project Gutenberg eBook of Army Pulse
Radiation Facility
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
Credits: Brian Coe, Lisa Corcoran, who supplied the scans, and the
Online Distributed Proofreading Team at
https://www.pgdp.net
Table I.
APRFR Core Design Data 8
Table II.
Typical APRFR Performance Levels 8
Table III.
APRFR Fluence and Flux Data 13
Table IV.
Nominal APRFR Leakage and U235 Fission
13
Spectra
Table V.
Fluence-to-Dose Conversion Factors for 14
APRFR Leakage Neutrons
Table VI.
Kerma and Kerma Rate in Tissue for APRFR
14
Exposure Conditions
Table VII.
Kerma and Kerma Rate in Silicon for APRFR
15
Exposure Conditions
Table VIII.
Neutron-to-Gamma Dose Ratios 15
Table IX.
APRF User Support Equipment 18