Test Bank For Big Java Early Objects 7th Edition
Test Bank For Big Java Early Objects 7th Edition
Test Bank for Big Java Early Objects 7th Edition by Cay S.
Horstmann
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?
1. primary storage
2. RAM
3. memory
4. secondary storage
Section Ref
Section 1.2 The Anatomy of a Computer
diff
1
Title
Which one of the following memory types provides storage that persists without
electricity?
type
mc
section
1.2 The Anatomy of a Computer
id
testbank-bj-6-ch01-7
8. Which one of the following memory types provides storage that is slower and less
expensive?
1. primary storage
2. secondary storage
3. peripheral device
4. the transistor
Section Ref
Section 1.2 The Anatomy of a Computer
diff
1
Title
Which one of the following memory types provides storage that is slower and less
expensive?
type
mc
section
1.2 The Anatomy of a Computer
id
testbank-bj-6-ch01-8
9. Which type of secondary storage consists of rotating platters coated with a magnetic
material?
1. hard disk
2. solid state drive
3. compact disk (CD)
4. memory
Section Ref
Section 1.2 The Anatomy of a Computer
diff
1
Title
Which type of secondary storage consists of rotating platters coated with a
magnetic material?
type
mc
section
1.2 The Anatomy of a Computer
id
testbank-bj-6-ch01-9
10. Some computers are self-contained units; others are interconnected through what?
1. bus
2. networks
3. peripheral devices
4. power lines
Section Ref
Section 1.2 The Anatomy of a Computer
diff
1
Title
Some computers are self-contained units; others are interconnected through what?
type
mc
section
1.2 The Anatomy of a Computer
id
testbank-bj-6-ch01-10
1. the CPU
2. primary storage
3. motherboard
4. speakers
Section Ref
Section 1.2 The Anatomy of a Computer
diff
1
Title
Which is an example of a peripheral device?
type
mc
section
1.2 The Anatomy of a Computer
id
testbank-bj-6-ch01-11
1. secondary storage
2. hard disk
3. primary storage
4. DVD
diff
1
Title
Which memory type does not provide persistent storage?
type
mc
section
1.2 The Anatomy of a Computer
Section reference
1.2 The Anatomy of a Computer
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?
1. memory
2. bus
3. hard disk
4. somewhere on the computer network
diff
1
Title
Where must program instructions and data reside in order for the CPU to read and
execute them?
type
mc
section
1.2 The Anatomy of a Computer
Section reference
1.2 The Anatomy of a Computer
id
testbank-bj-6-ch01-13
14. What term is used to refer to the computer instructions that are executed by a CPU?
1. virtual machine
2. machine code
3. high-level code
4. instruction set
Section Ref
Section 1.3 The Java Programming Language
diff
1
Title
What term is used to refer to the computer instructions that are executed by a CPU?
type
mc
section
1.3 The Java Programming Language
id
testbank-bj-6-ch01-14
16. What is the term used to refer to Java code that runs in a browser?
1. applet
2. script
3. html
4. class
diff
1
Title
What is the term used to refer to Java code that runs in a browser?
type
mc
section
1.3 The Java Programming Language
Section reference
1.3 The Java Programming Language
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?
1. virtual
2. high-level
3. sophisticated
4. conceptual
Section Ref
Section 1.3 The Java Programming Language
diff
1
Title
What term is used to refer to languages that allow programmers to describe tasks at
a higher conceptual level than machine code?
type
mc
section
1.3 The Java Programming Language
id
testbank-bj-6-ch01-17
18. What tool translates high-level instructions into low level machine code?
1. debugger
2. assembler
3. compiler
4. linker
Section Ref
Section 1.3 The Java Programming Language
diff
1
Title
What tool translates high-level instructions into low level machine code?
type
mc
section
1.3 The Java Programming Language
id
testbank-bj-6-ch01-18
19. What tool translates Java source code into files that contain instructions for the Java
Virtual Machine?
1. linker
2. compiler
3. assembler
4. interpreter
Section Ref
Section 1.3 The Java Programming Language
diff
1
Title
What tool translates Java source code into files that contain instructions for the
Java Virtual Machine?
type
mc
section
1.3 The Java Programming Language
id
testbank-bj-6-ch01-19
20. Which statement is true about running a Java program on a different CPU?
1. You need different Java source code for each CPU.
2. You can take code that has been generated by the Java compiler and run it on
different CPUs.
3. You need to compile the Java program for each CPU.
4. You cannot run the program on a different CPU because Java, being a high-level
programming language, is machine dependent.
Section Ref
Section 1.3 The Java Programming Langauge
diff
2
Title
Which statement is true about running a Java program on a different CPU?
type
mc
section
1.3 The Java Programming Language
id
testbank-bj-6-ch01-20
1. 1991
2. 1995
3. 2000
4. 2005
Section Ref
Section 1.3 The Java Programming Language
diff
1
Title
When was Java officially introduced?
type
mc
section
1.3 The Java Programming Language
id
testbank-bj-6-ch01-21
1. The same already-compiled Java programs will run on Windows, UNIX, Linux,
or Macintosh operating systems without any change.
2. The same Java compiler can be used on many operating systems.
3. There are only small differences between the Java programming language on
different operating systems.
4. 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
diff
1
Title
Which statement best describes the portability characteristic of Java?
type
mc
section
1.3 The Java Programming Language
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?
1. The time you spend will prevent data loss without the need for backups.
2. The tools needed for Java programming are different from other software.
3. Although computer systems vary widely, the Java programming environment is
always the same.
4. The Java libraries are detailed and extensive.
diff
1
Title
Why should you set aside time to become familiar with the programming
environment?
type
mc
section
1.4 Becoming Familiar with Your Programming Environment
Section reference
1.4 Becoming Familiar With Your Programming Environment
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?
1. You should have multiple copies of your source files in different locations.
2. You should regularly print out your work so you can retype it in case of data loss.
3. You should regularly back up the Java virtual machine instructions to prevent loss
of valuable work.
4. Your compiler automatically makes backups of your source files.
diff
1
Title
Which one of the following statements regarding backup strategies for Java files is
correct?
type
mc
section
1.4 Becoming Familiar with Your Programming Environment
Section reference
1.4 Becoming Familiar With Your Programming Environment
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.
1. class
2. CPU
3. applet
4. parameter
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
TB Every Java program consists of one or more of these fundamental building
blocks.
type
mc
section
1.5 Analyzing Your First Program
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?
1. HelloPrinter
2. HelloPrinter.java
3. HelloPrinter.class
4. HelloPrinter.txt
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
What is the name of the file that contains the Java source code for this class?
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-29
1. parameter
2. label
3. variable
4. method
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
A __________ contains sequences of programming instructions that describe how
to perform a particular task.
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-30
1. statement
2. constant
3. comment
4. object
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
What term is used to refer to an individual instruction inside a method?
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-31
1. .
2. )
3. !
4. ;
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
In Java, every statement must end with this symbol.
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-32
33. What term is used to refer to a sequence of characters enclosed in quotation marks?
1. string
2. object
3. comment
4. variable
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
What term is used to refer to a sequence of characters enclosed in quotation marks?
type
mc
section
1.5 Analyzing Your First Program
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?
1. class
2. object
3. argument
4. comment
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
What term is used to refer to values supplied to a method that are needed to carry
out its task?
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-34
1. ()
2. " "
3. {}
4. //
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
Arguments supplied to methods are enclosed by which symbols?
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-35
37. What is the syntax for calling the println method on the object System.out?
1. println("Any message").System.out;
2. System.out("Any message").println;
3. System.out.println("Any message");
4. println(System.out,"Any message");
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
What is the syntax for calling the println method on the object System.out?
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-37
38. What is the name of the method in the given method call?
System.out.println("Welcome");
1. "Welcome"
2. System
3. println
4. out
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
What is the name of the method in the given method call?
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-38
1. out
2. println
3. "Welcome"
4. System
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
What is the argument in the given method call?
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-39
1. 10
2. 46
3. 4
4. 4 + 6
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
What is the output of the following Java statement?
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-40
1. 4 + 6
2. 4
3. 10
4. 46
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
What is the output of the following Java statement?
type
mc
section
1.5 Analyzing Your First Program
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!");
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!");
1. Hello.java
2. Hello
3. No file is generated due to an error.
4. Hello.class
diff
1
Title
What is the name of the file generated by the Java compiler?
type
mc
section
1.6 Errors
Section reference
1.6 Errors
id
testbank-bj-6-ch01-46
48. What is the term used to describe an error detected by the compiler that is a violation of
the programming language rules?
1. logic error
2. compile-time error
3. run-time error
4. typo
Section Ref
Section 1.6 Errors
diff
1
Title
Term describing an error violating the programming language rules.
type
mc
section
1.6 Errors
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?
1. typo
2. logic error
3. syntax error
4. run-time error
Section Ref
Section 1.6 Errors
diff
1
Title
Another term describing an error violating the programming language rules.
type
mc
section
1.6 Errors
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?
1. typo
2. run-time error
3. compile-time error
4. syntax error
Section Ref
Section 1.6 Errors
diff
1
Title
Term describing an error causing a program to take an action that the programmer
did not intend)
type
mc
section
1.6 Errors
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?
1. syntax error
2. logic error
3. mistake
4. compile-time error
Section Ref
Section 1.6 Errors
diff
1
Title
Another term describing an error causing a program to take an action that the
programmer did not intend)
type
mc
section
1.6 Errors
id
testbank-bj-6-ch01-51
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!");
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?
1. Welcome.class
2. Welcome.java
3. No additional file is generated.
4. Welcome
Section Ref
Section 1.6 Errors
diff
1
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?
type
mc
section
1.6 Errors
id
testbank-bj-6-ch01-56
1. The compiler will generate CPU specific instructions even if it detects an error.
2. The compiler will generate Java virtual machine instructions even if it detects an
error.
3. The compiler will stop compiling when it finds the first error.
4. The compiler will continue compiling after it finds an error.
Section Ref
Section 1.6 Errors
diff
1
Title
Which statement is true about the compilation process?
type
mc
section
1.6 Errors
id
testbank-bj-6-ch01-57
58. Who or what is responsible for inspecting and testing the program to guard against logic
errors?
1. JVM
2. programmer
3. end-user
4. compiler
Section Ref
Section 1.6 Errors
diff
1
Title
Who/what is responsible for ... guarding against logic errors?
type
mc
section
1.6 Errors
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
60. The error message "cannot find symbol" is usually a good clue that what kind of error has
been made?
1. logic
2. spelling
3. run-time
4. division by zero
Section Ref
Section 1.6 Errors
diff
1
Title
The error message "cannot find symbol" is usually a good clue that what kind of
error has been made?
type
mc
section
1.6 Errors
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 ______________.
1. unambiguous
2. terminating
3. executable
4. documented
diff
1
Title
A sequence of steps that contains precise instructions...?
type
mc
section
1.7 Problem Solving: Algorithm Design
Section reference
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-61
1. unambiguous
2. terminating
3. executable
4. documented
diff
1
Title
A sequence of steps that can be carried out in practice ...?
type
mc
section
1.7 Problem Solving: Algorithm Design
Section reference
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-62
1. unambiguous
2. terminating
3. executable
4. documented
diff
1
Title
A sequence of steps that eventually comes to an end ...?
type
mc
section
1.7 Problem Solving: Algorithm Design
Section reference
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-63
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:
1. 27.7
2. 29.2
3. 34.4
4. 32.3
diff
2
Title
What is output of this pseudocode with these test values?
type
mc
section
1.7 Problem Solving: Algorithm Design
Section reference
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-65
66. Evaluate the given pseudocode to calculate the weighted score for a student:
1. 89.20
2. 89.80
3. 87.80
4. 92.20
diff
2
Title
What is the final output?
type
mc
section
1.7 Problem Solving: Algorithm Design
Section reference
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-66
67. Evaluate the given pseudocode to calculate the payment (pmt) with the following test
values:
1. 960
2. 840
3. 240
4. 720
diff
3
Title
What is output of this pseudocode with these test values?
type
mc
section
1.7 Problem Solving: Algorithm Design
Section reference
1.7 Problem Solving: Algorithm Design
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?
69. What term is used to refer to a sequence of steps for solving a problem that is
unambiguous, executable, and terminating?
1. documentation
2. pseudoprogram
3. algorithm
4. comments
Section Ref
Section 1.7 Problem Solving: Algorithm Design
diff
1
Title
What term is used to refer to a sequence of steps for solving a problem that is
unambiguous, executable, and terminating?
type
mc
section
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-69
1.
Algorithms are described informally and can contain ambiguous steps.
2.
Algorithms are written in a programming language.
3.
Algorithms can replace the source code in programs.
4.
You must create an algorithm for a problem before you can create a program to
solve the problem.
Section Ref
Section 1.7 Problem Solving: Algorithm Design
diff
1
Title
Which of the following options is true about algorithms?
type
mc
section
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-70
71. A sequence of steps is unambiguous when ___________________________
1. there are precise instructions for what to do at each step and where to go next.
2. it will eventually come to an end.
3. it can be documented.
4. it can be carried out in practice.
Section Ref
Section 1.7 Problem Solving: Algorithm Design
diff
1
Title
A sequence of steps is terminating when ...?
type
mc
section
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-73
75. Evaluate the given pseudocode to calculate the efficiency of a vehicle's fuel consumption
using the following test values:
76. Evaluate the given pseudocode to calculate the weighted score for a student:
1. 89.20
2. 87.80
3. 89.80
4. 92.20
Section Ref
Section 1.7 Problem Solving: Algorithm Design
diff
2
Title
What is output of this pseudocode with these test values?
type
mc
section
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-76
77. Evaluate the given pseudocode to calculate the payment (pmt) with the following test
values:
1. 540
2. 580
3. 500
4. 600
Section Ref
Section 1.7 Problem Solving: Algorithm Design
diff
3
Title
What is output of this pseudocode with these test values?
type
mc
section
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-77
78. What is the correct order of the steps in the program development process:
i. Unambiguous.
1. i, ii
2. i, ii, iii
3. i, iii, iv
4. ii, iii, iv
Section Ref
Section 1.7 Problem Solving: Algorithm Design
diff
1
Title
Pseudocode must be
type
mc
section
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-79