100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

Absolute C++ 6th Edition - Test Bank by Walter Savitch

Rating
-
Sold
-
Pages
364
Grade
A+
Uploaded on
03-07-2025
Written in
2024/2025

This complete test bank aligns with Absolute C++, 6th Edition by Walter Savitch, offering a wide array of practice and assessment questions designed to reinforce and evaluate learning throughout the textbook. It covers all chapters—including introductions to C++ syntax, data types, variables, control structures, functions, recursion, arrays, and strings—before progressing to deeper topics such as pointers, references, dynamic memory, classes and objects, operator overloading, inheritance, polymorphism, file input/output, templates, and the Standard Template Library (STL). Each chapter is supported by targeted multiple-choice, fill-in-the-blank, true/false, and short-answer questions that mirror the text’s progression, helping learners to review key concepts, prepare for quizzes and tests, and solidify their understanding of core programming techniques and best practices in C++.

Show more Read less
Institution
Absolute C++, 6th Edition
Module
Absolute C++, 6th edition











Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Absolute C++, 6th edition
Module
Absolute C++, 6th edition

Document information

Uploaded on
July 3, 2025
Number of pages
364
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

Chapter 1 - Test Questions
These test questions are fill in the blank, multiple choice, and true-false. The multiple
choice questions may have more than one correct answer. There is one matching
ST
question. Mark all of the correct answers for full credit.
True False questions require an explanation in addition to the true/false response, and, if
false, also require a correction.
U
True False:

Comment required.
VI
1. OOP is an acronym that means Object Oriented Programming.
Answer: True.
A
Explanation: OOP is currently popular and is a powerful programming technique for a
large class of problems.
_A
2. C++ not only supports OOP but also supports other programming styles.
Answer: True.
Explanation: C++ supports OOP and traditional procedure oriented programming.
PP
3. The namespace facility is a tool used that assists in the study of genealogy.
Answer: False.
Explanation: The namespace facility helps prevent the libraries from “preempting all the
good names,” and allows us to use names we want whether the library has used them.
RO
4. In C++ the variables Alpha, ALPHA and AlphA are the same identifier.
Answer: False.
Explanation: C++ is case sensitive, these are different identifiers.
VE
5. In C++ the compiler will infer the type intended for a variable from the context in
which the variable occurs.
Answer: False.
Explanation: C++ requires every identifier to be declared prior to use. The type is
D
specified in the declaration.
6. A C++ declaration introduces only an identifier's spelling and specifies its type.
?
Answer: True.
Explanation: A declaration introduces the spelling and type, whereas a definition is a

, Test Bank for Savitch Absolute C++ 6e Page 2


declaration that also allocates memory.
7. A C++ declaration is a definition that also allocates storage for an identifier's value
(or function's body etc.).
ST
Answer: True.
Explanation: A declaration introduces the spelling and type, whereas a definition is a
declaration that also allocates memory.
U
8. The range of values for an int variable is from about 0 to +2 billion.
Answer: False:
Explanation: The correct range is about –2 Billion to +2 Billion.
VI
9. The names x, y, and z are satisfactory variable names for the lengths of the legs and
hypotenuse of a triangle.
A
Answer: False.
Explanation: Names should communicate to the human reader the meaning of the value.
_A
These identifiers do not communicate the meaning of their values..
10. In C++ you can assign an expression of type int to a variable of type double with
no problem.
PP
Answer: True.
Explanation: Assignment from an integer type to a floating point type can lose
information and should be avoided. Some compilers will warn, others may give an error
message, but you should avoid this.
RO
11. In C++ you can assign an expression of type double to a variable of type int with
no problem.
Answer: False.
VE
Explanation: In general assigning a floating point value to an integer variable mostly
loses information. A warning message (or an error message) is issued by C++ compilers.
12. To put a character into a cstring constant that causes the output to continue on the
next line, insert the escape sequence \t into the string constant.
D
Answer: False.
Explanation: \t is the tab escape sequence. Use \n instead.
?
13. If we execute this code in an otherwise correct and complete program:
n = 1;


©2016 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.

, Test Bank for Savitch Absolute C++ 6e Page 3

n = (n++) + (n++);
the value of n is guaranteed to be 3 after the second line executes.
Answer: False.
ST
Explanation: Some compilers may give the value 3. The result of such code is dependent
on the compiler implementation. The C++ Standard says such code is illegal, and the
Standard says the results are undefined, meaning the compiler can do anything with it
U
that suits the compiler writer. One of my compilers gives the value 4 to n.
14. If we execute the code fragment in an otherwise complete, correct program:
VI
n = 1;
cout << n++ << " " << n++ << " " << n++ << endl;
the output is guaranteed to be 1 2 3.
A
Answer: False.
Explanation: The code is illegal because its execution depends on the order of evaluation
_A
of arguments. Various compilers give different answers. One compiler this writer uses
gives 3 2 1.
15. C++ uses only /* */ for comments.
PP
Answer: False.
Explanation: C++ uses /* */ comments and // “here to the end of the line”
comments.
16. A program’s comments should connect the program code to the problem being
RO
solved.
Answer: True.
Explanation: The purpose of comments in a program is to help the human reader of the
VE
code to connect the program to the problem being solved. Comments are so important
there is an aphorism, often quoted by expert programmers: “If the comments and the code
disagree, then both are probably wrong.
17. A program should have a comment on every line.
D
Answer: False.
Explanation: This would be satisfactory only on a very complicated assembly language
?
program for an inexperienced programmer.
18. Comments have no value whatsoever and do not belong in a program.


©2016 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.

, Test Bank for Savitch Absolute C++ 6e Page 4


Answer: False.
Explanation: The purpose of comments in a program is to help the human reader of the
code to connect the program to the problem being solved. Comments are valuable.
ST
19. The most difficult programming language construct to learn to use properly is the
comment.
Answer: True.
U
Explanation: How many comments and what should be in the comment is very hard to
decide because these depend on who is the intended reader of the code (and comments).
VI
20. A computer program is a set of instructions intended for only the computer to follow.
Answer: False.
Explanation: A computer program is also intended for human beings to read, and the
A
comments are intended to make this job easier.

Fill in the blank
_A
1. In C++, a legal identifiers may contain these kinds of characters _______________,
______________, ______________
Answer: Letters, digits, underscore
PP
Explanation: Some implementations allow a very few other characters such as $.
2. The C++ very nearly contains the ______ programming language as proper subset.
Answer: (the) C (programming language)
RO
3. In C++, a variable that has been defined but not initialized may not be use as an
______. (l-value or r-value).
Answer: r-value
Explanation: The value of an uninitialized variable may not be fetched. C++ does not
VE
enforce this. If an uninitialized variable’s value is fetched you get whatever value was left
in the memory location by a previous user. Note that the value is garbage in the
dictionary sense, It is not a random value.
D
4. Identifiers should at least give a hint to the human reader of the ________________
of the identifier in the context of the problem being solved.
?
Answer: Meaning

Explanation: Any identifier in a program that represents a quantity in a problem should


©2016 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.

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.
successhands Chamberlain College Of Nursing
Follow You need to be logged in order to follow users or courses
Sold
171
Member since
1 year
Number of followers
18
Documents
822
Last sold
3 days ago
Successhands – Verified Solutions, Test Banks &amp; Guides for Medical, Nursing, Business, Engineering, Accounting, Chemistry, Biology &amp; Other Subjects

Welcome to Your Ultimate Study Resource Hub! Looking for high-quality, reliable, and exam-ready study materials? You’re in the right place. Our shop specializes in original publisher content, including solutions manuals, test banks, and comprehensive study guides that are ideal for university and college students across various subjects. Every document is in PDF format and available for instant download—no waiting, no hassle. That means you get immediate access to top-tier academic resources the moment you need them, whether you're cramming for an exam or studying ahead. These materials are especially effective for exam preparation, offering step-by-step solutions, real test formats, and well-organized study guides that align with your coursework and textbooks. Whether you're a visual learner, a problem-solver, or need practice questions—there’s something for every study style. Love what you get? Share it! Help your mates and classmates succeed too by referring them to our shop. More learners, more success for all.

Read more Read less
4.4

14 reviews

5
9
4
2
3
2
2
1
1
0

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

Frequently asked questions