Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

Data Abstraction & Problem Solving with C++: Walls and Mirrors (7th Edition) – Frank M. Carrano & Timothy M. Henry | Complete Test Bank with Answers

Rating
-
Sold
-
Pages
131
Grade
A+
Uploaded on
22-05-2024
Written in
2023/2024

This document provides the complete Test Bank for Data Abstraction & Problem Solving with C++: Walls and Mirrors (7th Edition) by Frank M. Carrano and Timothy M. Henry. It includes comprehensive multiple-choice, true/false, and short-answer questions for every chapter, each with verified answers and detailed explanations. Topics covered include object-oriented programming, data abstraction, recursion, linked structures, stacks, queues, trees, sorting, searching, and algorithm analysis. Perfectly aligned with the textbook, this Test Bank is ideal for instructors developing assessments and students preparing for exams in computer science and programming courses.

Show more Read less
Institution
Data Abstraction & Problem Solving With C++ Walls
Module
Data Abstraction & Problem Solving with C++ Walls

Content preview

Chapter 1 Questions


Multiple Choice Questions

1. The specifications of an ADT’s operations indicate ______.
a. what the operations do
b. how to implement the operations
c. how to store the data in the ADT
d. how to carry out the operations
Answer: a.

2. Data structures are part of an ADT’s ______.
a. definition
b. implementation
c. specifications
d. usage
Answer: b.

3. A(n) ______ allows two modules to communicate with each other.
a. data structure
b. axiom
c. interface
d. client
Answer: c.

4. An ADT’s ______ govern(s) what its operations are and what they do.
a. specifications
b. implementation
c. documentation
d. data structure
Answer: a.

5. When each module performs one well-defined task, we say that it is ___.
a. loosely coupled
b. highly coupled
c. cohesive
d. not easily reused
Answer: c.

6. When should an operation contract be written?
a. during analysis
b. after coding
c. at the same time as user documentation
d. when taking initial notes from client
Answer: a.

7. What information is included in the operation contract?
a. the method’s interface
b. data flow among the modules
c. assumptions about input
d. all of these
Answer: d.

8. What kind of interface contains a method if and only that method is essential to that class’s
responsibilities?
a. complete
b. minimal



© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.

, Chapter 1 Questions

c. expanded
d. compact
Answer: b.

9. What must be known about the ADT Bag in order to use it in a program?
a. how entries in the bag are represented
b. how bag operations are implemented
c. how many entries can be stored in the bag
d. the interface of the bag
Answer: d.

10. According the CRC specifications for a Bag, which of the following behaviors would not be one of the
responsibilities of the class Bag?
a. See if the bag is empty
b. See if the bag is full
c. Look at all the objects in the bag
d. Count the number of times a certain object occurs in the bag
Answer: b.


11. A client program depends solely on the ______ of the ADT.
a. data members
b. structure
c. implementation
d. behavior
Answer: d.

12. What should a programmer do before implementing a recently designed class?
a. write code that uses the class
b. check comments that document specifications
c. adjust the design when problems are discovered
d. all of these
Answer: d

13. Object-oriented programming views a program as ______.
a. a sequence of actions
b. a collection of classes
c. a group of methods
d. an interaction among objects
Answer: d.

14. An ADT’s operations are known as its ______.
a. axioms
b. methods
c. variables
d. interfaces
Answer: b.

15. Encapsulation combines an ADT’s data with its operations to form a(n) ______.
a. exception
b. method
c. object
d. variable
Answer: c.

16. A(n) ______ is a C++ construct that enables a programmer to define a new data type.



© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.

, Chapter 1 Questions

a. class
b. method
c. data field
d. object
Answer: a.

17. A C++ class contains data members and ______.
a. clients
b. interfaces
c. methods
d. data structures
Answer: c.

18. A(n) ______ is an instance of a class.
a. method
b. data field
c. interface
d. object
Answer: d.

19. A(n) ______ is a class that inherits the members of another class.
a. base class
b. superclass
c. abstract class
d. subclass
Answer: d.


20. A function can indicate that an error has occurred by ______ an exception.
a. throwing
b. catching
c. implementing
d. declaring
Answer: a.

21. To ______ an exception means to deal with the error condition.
a. declare
b. catch
c. implement
d. try
Answer: b.

22. Which of the following are ways to address unusual situations?
a. simply assume the invalid situation will never occur
b. guess at the client’s intention
c. return a value that signals a problem
d. all of the above are options
Answer: d.


23. For the method remove(anEntry) of the ADT Bag, what would be the output of the method?
a. anEntry
b. nothing
c. true or false
d. the previous position of anEntry in the bag
Answer: c


© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.

, Chapter 1 Questions


24. What is the task of the toVector() method of the ADT Bag?
a. copy the entries of the bag into a vector
b. vector the entries to the printer
c. test to see if there is a vector to the bag
d. remove all objects from the bag
Answer: a

25. Understanding what the problem is and what the requirements of a solution are is called
a. Object Oriented Analysis
b. Object Oriented Design
c. Object Oriented Solution
d. Algorithmic Oriented Design
Answer: a.

26. Objects collaborate when they
a. are cohesive
b. are used by a programming team
c. send each other messages
d. model a real life situation
Answer: c.

27. Which of the following could not be a module?
a. a standalone function
b. a data member
c. a class method
d. a class itself
Answer: b.




© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.

Written for

Institution
Data Abstraction & Problem Solving with C++ Walls
Module
Data Abstraction & Problem Solving with C++ Walls

Document information

Uploaded on
May 22, 2024
Number of pages
131
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$38.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
CadUsTestBanks Teachme2-tutor
View profile
Follow You need to be logged in order to follow users or courses
Sold
126
Member since
2 year
Number of followers
32
Documents
287
Last sold
1 week ago
Canadian TestBanks

Welcome to CanadianTestBanks – your one-stop shop for academic excellence! Elevate your learning experience with our high-quality, expert-curated test banks covering a range of subjects. Our user-friendly platform ensures easy access to the latest editions, providing you with the confidence to ace your exams. Shop with us and unlock your academic potential at CanadianTestBanks!

4.8

55 reviews

5
50
4
3
3
0
2
1
1
1

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions