Program Design and Data Structures
ST
5th Edition
UV
TEST BANK
IA
?_
AP
John Lewis
Peter DePasquale
PR
Joe Chase
OV
Comprehensive Test Bank for Instructors
and Students
ED
© John Lewis, Peter DePasquale & Joe Chase. All rights reserved. Reproduction or
??
distribution without permission is prohibited.
©MEDCONNOISSEUR
, Table of Contents
Test Bank for Java Foundations: Introduction to Program Design and Data
Structures (5th Edition)
ISBN: 9780137518401
ST
Chapter 1: Data and Expressions
UV
Chapter 2: Using Classes and Objects
Chapter 3: Conditionals and Loops
Chapter 4: Writing Classes
Chapter 5: Graphical User Interfaces
Chapter 6: Arrays
IA
Chapter 7: Inheritance
Chapter 8: Polymorphism
Chapter 9: Exceptions
?_
Chapter 10: Analysis of Algorithms
Chapter 11: Introduction to Collections – Stacks
Chapter 12: Linked Structures – Stacks
Chapter 13: Queues
AP
Chapter 14: Lists
Chapter 15: Iterators
Chapter 16: Recursion
Chapter 17: Searching and Sorting
PR
Chapter 18: Trees
Chapter 19: Binary Search Trees
Chapter 20: Heaps and Priority Queues
Chapter 21: Sets and Maps
Chapter 22: Multi-way Search Trees
OV
Chapter 23: Graphs
Chapter 24: Databases
ED
??
©MEDCONNOISSEUR
, Java Foundations: Introduction to Program Design & Data Structures, 5e
John Lewis, Peter DePasquale, Joseph Chase
Test Bank: Chapter 1
Chapter 1: Introduction
ST
Multiple Choice Questions:
1) consists of specific words and symbols to express a problem solution.
UV
a) A programming language
b) Software
c) Hardware
d) A computer
e) An application
IA
Answer: a
Explanation: A programming language consists of words and symbols to express a problem solution. Software consists
of programs and the data these programs use. Hardware is the tangible parts of a computer, such as keyboards and hard disks.
A computer is made up of hardware and software, and an application is a program that runs on a computer.
?_
2) Java is .
a) a procedural language
b) a functional language
c) an object-oriented language
d) a fourth-generation language
AP
e) a spoken-language
Answer: c
Explanation: Java is best described as an object-oriented language. Procedural languages, functional languages and
fourth-generation languages are different types of languages that don't necessarily include object-oriented features. A spoken
language is a language such as English or Spanish, and is too ambiguous for a computer to use.
PR
3) Problem domain describes
a) the set of problems that are encountered when testing a program
b) the alternate ways to design the solution
c) the challenges in implementing the solution
OV
d) the real-world issues that are key to a solution
e) all of the above
Answer: d
Explanation: The problem domain is the set of real-world issues that are key to a solution.
ED
??
1
Pearson © 2019
, Java Foundations: Introduction to Program Design & Data Structures, 5e
John Lewis, Peter DePasquale, Joseph Chase
Test Bank: Chapter 1
4) In order for a program to run on a computer, it must be expressed in .
ST
a) an assembly language
b) a machine language
c) a high-level language
d) an object-oriented language
UV
e) a fourth generation language
Answer: b
Explanation: A computer can only understand its machine language. Assembly languages, high-level languages, object-
oriented languages and fourth generation languages are are languages that are easy for humans to understand, but they must first
be translated into a machine language before they are run on a computer.
IA
5) A syntax error is a .
a) a logical error
b) a compile-time error
c) a run-time error
?_
d) a bug
e) an exception
Answer: b
Explanation: A program that contains a syntax error is invalid, and therefore cannot be compiled. It is a compile-time
error because it is caught by the compiler. A logical error is an error that causes a running program to behave in an unexpected
AP
manner during run-time. A bug is an example of a logical error. A run-time error is an error that happens while the program is
running. In Java, run-time errors are called exceptions.
6) Which of the following is not one of the four basic software development activities?
a) establishing the requirements
PR
b) creating a design
c) preliminary practice coding
d) testing
e) implementing the design
Answer: c
OV
Explanation: Preliminary practice coding is not one of the four basic software development activities. Establishing the
requirements for a program, creating a design for a program, implementing the design and testing the program all occur during
software development.
7) Software requirements specify .
a) what a program should accomplish
ED
b) which programming language the developer should use
c) how objects should be encapsulated
d) how a solution should be implemented
e) a programming schedule
Answer: a
Explanation: Software requirements specify what a program should accomplish. They do not specify how a program or
??
a programmer should get a program to work as it is supposed to, and therefore none of the other choices are correct.
2
Pearson © 2019