Test Bank For Big Java Early Objects 6th Edition
Test Bank For Big Java Early Objects 6th Edition
Test Bank for Big Java Early Objects 6th Edition by Cay S.
Horstmann (Author
1 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...
6. Which type of storage is made from electronic circuits that can store data?
7. Which one of the following memory types provides storage that persists without electricity?
A. primary storage
B. RAM
C. memory
D. secondary storage Answer
Section Ref Section 1.2 The Anatomy of a Computer
Title Which one of the following memory types provides storage that persists without electricity?
Difficulty Easy
id testbank-bj-6-ch01-07
8. Which one of the following memory types provides storage that is slower and less expensive?
A. primary storage
B. secondary storage Answer
C. peripheral device
D. the transistor
Section Ref Section 1.2 The Anatomy of a Computer
Title Which one of the following memory types provides storage that is slower and less
expensive?
Difficulty Easy
id testbank-bj-6-ch01-08
9. Which type of secondary storage consists of rotating platters coated with a magnetic material?
2 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...
Title Which type of secondary storage consists of rotating platters coated with a magnetic
material?
Difficulty Easy
id testbank-bj-6-ch01-09
10. Some computers are self-contained units; others are interconnected through what?
A. bus
B. networks Answer
C. peripheral devices
D. power lines
Section Ref Section 1.2 The Anatomy of a Computer
Title Some computers are self-contained units; others are interconnected through what?
Difficulty Easy
id testbank-bj-6-ch01-10
A. the CPU
B. primary storage
C. motherboard
D. speakers Answer
Section Ref Section 1.2 The Anatomy of a Computer
Title Which is an example of a peripheral device?
Difficulty Easy
id testbank-bj-6-ch01-11
A. secondary storage
B. hard disk
C. primary storage Answer
D. DVD
Title Which memory type does not provide persistent storage?
Section reference 1.2 The Anatomy of a Computer
Difficulty Easy
id testbank-bj-6-ch01-12
13. Where must program instructions and data reside in order for the CPU to directly read and execute
them?
A. memory Answer
B. bus
C. hard disk
D. somewhere on the computer network
Title Where must program instructions and data reside in order for the CPU to read and execute
them?
Section reference 1.2 The Anatomy of a Computer
Difficulty Easy
id testbank-bj-6-ch01-13
3 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...
14. What term is used to refer to the computer instructions that are executed by a CPU?
A. virtual machine
B. machine code Answer
C. high-level code
D. instruction set
Section Ref Section 1.3 The Java Programming Language
Title What term is used to refer to the computer instructions that are executed by a CPU?
Difficulty Easy
id testbank-bj-6-ch01-14
16. What is the term used to refer to Java code that runs in a browser?
A. applet Answer
B. script
C. html
D. class
Title What is the term used to refer to Java code that runs in a browser?
Section reference 1.3 The Java Programming Language
Difficulty easy
id testbank-bj-6-ch01-16
17. What term is used to refer to languages that allow programmers to describe tasks at a higher conceptual
level than machine code?
A. virtual
B. high-level Answer
C. sophisticated
D. conceptual
Section Ref Section 1.3 The Java Programming Language
Title What term is used to refer to languages that allow programmers to describe tasks at a higher
conceptual level than machine code?
Difficulty Easy
id testbank-bj-6-ch01-17
18. What tool translates high-level instructions into low level machine code?
A. debugger
B. assembler
4 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...
C. compiler Answer
D. linker
Section Ref Section 1.3 The Java Programming Language
Title What tool translates high-level instructions into low level machine code?
Difficulty Easy
id testbank-bj-6-ch01-18
19. What tool translates Java source code into files that contain instructions for the Java Virtual Machine?
A. linker
B. compiler Answer
C. assembler
D. interpreter
Section Ref Section 1.3 The Java Programming Language
Title What tool translates Java source code into files that contain instructions for the Java Virtual
Machine?
Difficulty Easy
id testbank-bj-6-ch01-19
20. Which statement is true about running a Java program on a different CPU?
A. 1991
B. 1995 Answer
C. 2000
D. 2005
Section Ref Section 1.3 The Java Programming Language
Title When was Java officially introduced?
Difficulty Easy
id testbank-bj-6-ch01-21
A. The same already-compiled Java programs will run on Windows, UNIX, Linux, or Macintosh
operating systems without any change. Answer
B. The same Java compiler can be used on many operating systems.
C. There are only small differences between the Java programming language on different operating
systems.
5 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...
D. It is easy to change a Java program so that it will work on different operating systems.
Section Ref Section 1.3 The Java Programming Language
Title Which statement best describes the portability characteristic of Java?
Difficulty Easy
id testbank-bj-6-ch01-22
23. No matter which Java development environment you use, what happens to the Java source code in
order for a Java program to execute?
24. Why should you set aside time to become familiar with the programming environment?
A. The time you spend will prevent data loss without the need for backups.
B. The tools needed for Java programming are different from other software. Answer
C. Although computer systems vary widely, the Java programming environment is always the same.
D. The Java libraries are detailed and extensive.
Title Why should you set aside time to become familiar with the programming environment?
Section reference 1.4 Becoming Familiar With Your Programming Environment
Difficulty Easy
id testbank-bj-6-ch01-24
25. Suppose that a computer virus infects your computer and corrupts the files you were going to submit
for your current homework assignment. What precaution could have saved you from a disastrously bad
grade for this assignment?
26. Which statement regarding backup strategies for Java files is correct?
A. You should have multiple copies of your source files in different locations. Answer
B. You should regularly print out your work so you can retype it in case of data loss.
C. You should regularly back up the Java virtual machine instructions to prevent loss of valuable
work.
D. Your compiler automatically makes backups of your source files.
6 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...
Title Which one of the following statements regarding backup strategies for Java files is correct?
Section reference 1.4 Becoming Familiar With Your Programming Environment
Difficulty Easy
id testbank-bj-6-ch01-26
27. The line public class HelloPrinter indicates which declaration below?
28. Every Java program consists of one or more of these fundamental building blocks.
A. class Answer
B. CPU
C. applet
D. parameter
Section Ref Section 1.5 Analyzing Your First Program
Title TB Every Java program consists of one or more of these fundamental building blocks.
Difficulty Easy
id testbank-bj-6-ch01-28
29. What is the name of the file that contains the Java source code for the public class HelloPrinter?
A. HelloPrinter
B. HelloPrinter.java Answer
C. HelloPrinter.class
D. HelloPrinter.txt
Section Ref Section 1.5 Analyzing Your First Program
Title What is the name of the file that contains the Java source code for this class?
Difficulty Easy
id testbank-bj-6-ch01-29
30. A __________ contains sequences of programming instructions that describe how to perform a
particular task.
A. parameter
B. label
C. variable
D. method Answer
Section Ref Section 1.5 Analyzing Your First Program
Title A __________ contains sequences of programming instructions that describe how to
perform a particular task.
Difficulty Easy
id testbank-bj-6-ch01-30
7 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...
A. statement Answer
B. constant
C. comment
D. object
Section Ref Section 1.5 Analyzing Your First Program
Title What term is used to refer to an individual instruction inside a method?
Difficulty Easy
id testbank-bj-6-ch01-31
A. .
B. )
C. !
D. ; Answer
33. What term is used to refer to a sequence of characters enclosed in quotation marks?
A. string Answer
B. object
C. comment
D. variable
Section Ref Section 1.5 Analyzing Your First Program
Title What term is used to refer to a sequence of characters enclosed in quotation marks?
Difficulty Easy
id testbank-bj-6-ch01-33
34. What term is used to refer to values supplied to a method that are needed to carry out its task?
A. class
B. object
C. argument Answer
D. comment
Section Ref Section 1.5 Analyzing Your First Program
Title What term is used to refer to values supplied to a method that are needed to carry out its
task?
Difficulty Easy
id testbank-bj-6-ch01-34
A. () Answer
B. " "
C. {}
8 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...
D. //
Section Ref Section 1.5 Analyzing Your First Program
Title Arguments supplied to methods are enclosed by which symbols?
Difficulty Easy
id testbank-bj-6-ch01-35
37. What is the syntax for calling the println method on the object System.out?
A. println("Any message").System.out;
B. System.out("Any message").println;
C. System.out.println("Any message"); Answer
D. println(System.out,"Any message");
Section Ref Section 1.5 Analyzing Your First Program
Title What is the syntax for calling the println method on the object System.out?
Difficulty Easy
id testbank-bj-6-ch01-37
38. What is the name of the method in the given method call?
System.out.println("Welcome");
A. "Welcome"
B. System
C. println Answer
D. out
Section Ref Section 1.5 Analyzing Your First Program
Title What is the name of the method in the given method call?
Difficulty Easy
id testbank-bj-6-ch01-38
System.out.println("Welcome");
A. out
B. println
C. "Welcome" Answer
D. System
Section Ref Section 1.5 Analyzing Your First Program
Title What is the argument in the given method call?
9 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...
Difficulty Easy
id testbank-bj-6-ch01-39
A. 10
B. 46
C. 4
D. 4 + 6 Answer
System.out.println(4 + 6);
A. 4 + 6
B. 4
C. 10 Answer
D. 46
Section Ref Section 1.5 Analyzing Your First Program
Title What is the output of the following Java statement?
Difficulty Easy
id testbank-bj-6-ch01-41
42. Which statement is true about the following Java code fragment:
System.out.println("Hello!);
43. Assuming the programmer wishes to display "Hello!" on the screen, which statement is true about the
following Java code fragment:
System.out.println("Helo!");
10 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...
44. Assuming the programmer wishes to display "Hello!" on the screen, which statement is true about the
following Java code fragment:
System.out.println("Hello!");
45. Assuming the programmer wishes to display "Hello!" on the screen, which statement is true about the
following Java code fragment:
System.out.printn("Helo!");
46. Assume that the following Java statement is contained in the main method of the class named Hello:
System.out.printLine("Hello!");
A. Hello.java
B. Hello
C. No file is generated due to an error. Answer
D. Hello.class
Title What is the name of the file generated by the Java compiler?
Section reference 1.6 Errors
Difficulty Easy
id testbank-bj-6-ch01-46
11 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...
48. What is the term used to describe an error detected by the compiler that is a violation of the
programming language rules?
A. logic error
B. compile-time error Answer
C. run-time error
D. typo
Section Ref Section 1.6 Errors
Title Term describing an error violating the programming language rules.
Difficulty Easy
id testbank-bj-6-ch01-48
49. Other than compile-time error, what is another term used to describe an error detected by the compiler
that is a violation of the programming language rules?
A. typo
B. logic error
C. syntax error Answer
D. run-time error
Section Ref Section 1.6 Errors
Title Another term describing an error violating the programming language rules.
Difficulty Easy
id testbank-bj-6-ch01-49
50. What is the term used to describe an error causing a program to take an action that the programmer did
not intend?
A. typo
B. run-time error Answer
C. compile-time error
D. syntax error
Section Ref Section 1.6 Errors
Title Term describing an error causing a program to take an action that the programmer did not
intend)
Difficulty Easy
id testbank-bj-6-ch01-50
51. Other than run-time error, what is another term used to describe an error causing a program to take an
action that the programmer did not intend?
A. syntax error
B. logic error Answer
C. mistake
D. compile-time error
12 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...
System.out.Println("Welcome!");
53. Assuming the programmer wishes to output the phrase "Hello!", which of the following is true about
the following Java statement:
System.out.println("Welcme!");
54. Assuming the programmer wishes to output the phrase "Welcome!", Which statement is true about the
following Java statement:
System.out.println("Welcome!");
55. Assuming the programmer wishes to output the phrase "Welcome!", which of the following is true
about the following Java statement.
System.out.Println("Wlcome!");
13 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...
56. Assume that the main method of the class named Welcome does not contain any compile-time errors.
What is the name of the file generated by the Java compiler?
A. Welcome.class Answer
B. Welcome.java
C. No additional file is generated.
D. Welcome
Section Ref Section 1.6 Errors
Title Assume that the main method of the class named Welcome does not contain any
compile-time errors. What is the name of the file generated by the Java compiler?
Difficulty Easy
id testbank-bj-6-ch01-56
A. The compiler will generate CPU specific instructions even if it detects an error.
B. The compiler will generate Java virtual machine instructions even if it detects an error.
C. The compiler will stop compiling when it finds the first error.
D. The compiler will continue compiling after it finds an error. Answer
Section Ref Section 1.6 Errors
Title Which statement is true about the compilation process?
Difficulty Easy
id testbank-bj-6-ch01-57
58. Who or what is responsible for inspecting and testing the program to guard against logic errors?
A. JVM
B. programmer Answer
C. end-user
D. compiler
Section Ref Section 1.6 Errors
Title Who/what is responsible for ... guarding against logic errors?
Difficulty Easy
id testbank-bj-6-ch01-58
59. If you get a sequence of error messages from the compiler that are increasingly off track, you should
14 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...
Title If you get a sequence of error messages from the compiler that are increasingly off track,
you should
Difficulty Easy
id testbank-bj-6-ch01-59
60. The error message "cannot find symbol" is usually a good clue that what kind of error has been made?
A. logic
B. spelling Answer
C. run-time
D. division by zero
Section Ref Section 1.6 Errors
Title The error message "cannot find symbol" is usually a good clue that what kind of error has
been made?
Difficulty Easy
id testbank-bj-6-ch01-60
61. A sequence of steps that contains precise instructions for what to do at each step and where to go next
is ______________.
A. unambiguous Answer
B. terminating
C. executable
D. documented
Title A sequence of steps that contains precise instructions...?
Section reference 1.7 Problem Solving: Algorithm Design
Difficulty Easy
id testbank-bj-6-ch01-61
A. unambiguous
B. terminating
C. executable Answer
D. documented
Title A sequence of steps that can be carried out in practice ...?
Section reference 1.7 Problem Solving: Algorithm Design
Difficulty Easy
id testbank-bj-6-ch01-62
A. unambiguous
B. terminating Answer
C. executable
D. documented
Title A sequence of steps that eventually comes to an end ...?
Section reference 1.7 Problem Solving: Algorithm Design
Difficulty Easy
id testbank-bj-6-ch01-63
15 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...
input somenum
Repeat the following steps for 14 times
input variable1
if variable1 < somenum then
somenum = variable1
print somenum
65. Evaluate the given pseudocode to calculate the efficiency of a vehicle's fuel consumption using the
following test values, rounded to one decimal place:
input odometer
input amount
output odometer/amount
A. 27.7
B. 29.2 Answer
C. 34.4
D. 32.3
Title What is output of this pseudocode with these test values?
Section reference 1.7 Problem Solving: Algorithm Design
Difficulty Medium
id testbank-bj-6-ch01-65
66. Evaluate the given pseudocode to calculate the weighted score for a student:
16 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...
input homework
input hwWeight
input exams
input exWeight
output homework*hwWeight + exams*exWeight
A. 89.20
B. 89.80 Answer
C. 87.80
D. 92.20
Title What is the final output?
Section reference 1.7 Problem Solving: Algorithm Design
Difficulty Medium
id testbank-bj-6-ch01-66
67. Evaluate the given pseudocode to calculate the payment (pmt) with the following test values:
input working_hours
input rate
pmt = working_hours * rate
if working_hours > 40 then
extra_hours = working_hours - 40
extra_pmt = extra_hours * rate
pmt = pmt + extra_pmt
output pmt
A. 960 Answer
B. 840
C. 240
D. 720
Title What is output of this pseudocode with these test values?
Section reference 1.7 Problem Solving: Algorithm Design
Difficulty Hard
id testbank-bj-6-ch01-67
68. What term is used to refer to an informal description of a sequence of steps for solving a problem?
17 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...
69. What term is used to refer to a sequence of steps for solving a problem that is unambiguous,
executable, and terminating?
A. documentation
B. pseudoprogram
C. algorithm Answer
D. comments
Section Ref Section 1.7 Problem Solving: Algorithm Design
Title What term is used to refer to a sequence of steps for solving a problem that is unambiguous,
executable, and terminating?
Difficulty Easy
id testbank-bj-6-ch01-69
18 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...
A. there are precise instructions for what to do at each step and where to go next.
B. it will eventually come to an end. Answer
C. it can be documented.
D. it can be carried out in practice.
Section Ref Section 1.7 Problem Solving: Algorithm Design
Title A sequence of steps is terminating when ...?
Difficulty Easy
id testbank-bj-6-ch01-73
input num
Repeat the following steps for 9 times
input var1
if var1 > num then
num = var1
print num
75. Evaluate the given pseudocode to calculate the efficiency of a vehicle's fuel consumption using the
following test values:
input odometer
input amount
output odometer/amount
A. 15
B. 10
C. 30
19 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...
D. 20 Answer
Section Ref Section 1.7 Problem Solving: Algorithm Design
Title What is output of this pseudocode with these test values?
Difficulty Medium
id testbank-bj-6-ch01-75
76. Evaluate the given pseudocode to calculate the weighted score for a student:
input program
input pgmWeight
input exams
input exWeight
output program*pgmWeight + exams*exWeight
A. 89.20
B. 87.80 Answer
C. 89.80
D. 92.20
Section Ref Section 1.7 Problem Solving: Algorithm Design
Title What is output of this pseudocode with these test values?
Difficulty Medium
id testbank-bj-6-ch01-76
77. Evaluate the given pseudocode to calculate the payment (pmt) with the following test values:
input working_hours
input rate
pmt = working_hours * rate
if working_hours > 40 then
extra_hours = working_hours – 40
extra_pmt = extra_hours * rate
pmt = pmt + extra_pmt
end of if
output pmt
20 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...
A. 540
B. 580
C. 500
D. 600 Answer
Section Ref Section 1.7 Problem Solving: Algorithm Design
Title What is output of this pseudocode with these test values?
Difficulty Hard
id testbank-bj-6-ch01-77
78. What is the correct order of the steps in the program development process:
i. Unambiguous.
A. i, ii
B. i, ii, iii
C. i, iii, iv Answer
D. ii, iii, iv
Section Ref Section 1.7 Problem Solving: Algorithm Design
Title Pseudocode must be
Difficulty Easy
id testbank-bj-6-ch01-79
21 of 21 5/27/17, 8:21 PM