Programming in C++ MCQ PDF
Programming in C++ MCQ PDF
https://quizplus.com/study-set/1523
20 Chapters
891 Verified Questions
Programming in C++
MCQ PDF
Cou
Programming in C++ offers a comprehensive introduction to one of the most widely
polymorphism, and encapsulation. Students will develop the ability to design and
examples and hands-on projects. Additionally, the course explores advanced topics
such as memory management, templates, and the Standard Template Library (STL),
equipping students with both theoretical knowledge and practical skills to tackle
Recommended Textbook
Starting Out with C++ from Control Structures to Objects 8th Edition by Tony Gaddis
Page 2
Chapter 1: Introduction to Computers and Programming
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/30143
Sample Questions
Q1) Which of the following is a common input device?
A)Keyboard
B)Mouse
C)Scanner
D)Microphone
E)All of the above
Answer: E
Q3) Pseudocode is a form of program statement that will always evaluate to "false."
A)True
B)False
Answer: False
To view all questions and flashcards with answers, click on the resource link above.
Page 3
Chapter 2: Introduction to C Plus Plus
Available Study Resources on Quizplus for this Chatper
60 Verified Questions
60 Flashcards
Source URL: https://quizplus.com/quiz/30154
Sample Questions
Q1) Which character signifies the beginning of an escape sequence?
A)//
B)/
C)\
D)#
E){
Answer: C
Q2) This is used to mark the end of a complete C++ programming statement.
A)Pound Sign
B)Semicolon
C)Data type
D)Void
E)None of the above
Answer: B
To view all questions and flashcards with answers, click on the resource link above.
Page 4
Chapter 3: Expressions and Interactivity
Available Study Resources on Quizplus for this Chatper
44 Verified Questions
44 Flashcards
Source URL: https://quizplus.com/quiz/30156
Sample Questions
Q1) In C++, it is impossible to display the number 34.789 in a field of 9 spaces with 2
decimal places of precision.
A)True
B)False
Answer: False
Q2) If you want to know the length of the string that is stored in a string object, you can
call the object's size member function.
A)True
B)False
Answer: False
Q3) You can use these to override the rules of operator precedence in a mathematical
expression.
A)[Brackets]
B)(Parentheses)
C){Braces}
D)The escape character \
E)None of these
Answer: B
To view all questions and flashcards with answers, click on the resource link above.
Page 5
Chapter 4: Making Decisions
Available Study Resources on Quizplus for this Chatper
53 Verified Questions
53 Flashcards
Source URL: https://quizplus.com/quiz/30157
Sample Questions
Q1) As a rule of style, when writing an if statement you should indent the
conditionally-executed statements.
A)True
B)False
Q3) This is a variable, usually a bool or an int, that signals when a condition exists.
A)relational operator
B)arithmetic operator
C)flag
D)float
E)None of these
To view all questions and flashcards with answers, click on the resource link above.
Page 6
Chapter 5: Loops and Files
Available Study Resources on Quizplus for this Chatper
63 Verified Questions
63 Flashcards
Source URL: https://quizplus.com/quiz/30158
Sample Questions
Q1) This is a special value that marks the end of a list of values.
A)constant
B)variable
C)loop
D)sentinel
E)None of these
Q2) To read data from a file, you define an object of this data type.
A)inputFile
B)ifstream
C)fstream
D)ofstream
Q3) These are operators that add and subtract one from their operands.
A)plus and minus
B)++ and --
C)binary and unary
D)conditional and relational
E)None of these
To view all questions and flashcards with Page 7 click on the resource link above.
answers,
Chapter 6: Functions
Available Study Resources on Quizplus for this Chatper
49 Verified Questions
49 Flashcards
Source URL: https://quizplus.com/quiz/30159
Sample Questions
Q1) The value in this type of local variable persists between function calls.
A)global
B)internal
C)static
D)dynamic
E)None of these
Q3) Functions are ideal for use in menu-driven programs. When a user selects a menu
item, the program can ________ the appropriate function.
A)call
B)prototype
C)define
D)declare
E)None of these
Q4) When a function is called, flow of control moves to the function's prototype.
A)True
B)False
To view all questions and flashcards with answers, click on the resource link above.
Page 8
Chapter 7: Arrays
Available Study Resources on Quizplus for this Chatper
58 Verified Questions
58 Flashcards
Source URL: https://quizplus.com/quiz/30160
Sample Questions
Q1) Although two-dimensional arrays are a novel idea, there is no known way to pass
one to a function.
A)True
B)False
Q2) In C++ 11, you cannot use a range-based for loop to modify the contents of an array
unless you declare the range variable as a reference.
A)True
B)False
Sample Questions
Q1) The advantage of a linear search is its ________.
A)complexity
B)efficiency
C)simplicity
D)speed
E)None of these
To view all questions and flashcards with answers, click on the resource link above.
Page 10
Chapter 9: Pointers
Available Study Resources on Quizplus for this Chatper
45 Verified Questions
45 Flashcards
Source URL: https://quizplus.com/quiz/30162
Sample Questions
Q1) An array name is a pointer constant because the address stored in it cannot be
changed during runtime.
A)True
B)False
Q2) To help prevent memory leaks from occurring in C++ 11, a ________ automatically
deletes a chunk of dynamically allocated memory when the memory is no longer being
used.
A)null pointer
B)smart pointer
C)dereferenced pointer
D)A and C only
E)None of these
Q3) When this is placed in front of a variable name, it returns the address of that
variable.
A)asterisk ( * )
B)conditional operator
C)ampersand ( & )
D)semicolon ( ; )
E)None of these
To view all questions and flashcards with answers, click on the resource link above.
Page 11
Chapter 10: Characters, C-Strings, and More About the
String Class
Available Study Resources on Quizplus for this Chatper
45 Verified Questions
45 Flashcards
Source URL: https://quizplus.com/quiz/30144
Sample Questions
Q1) If an uppercase character is passed as an argument to toupper, the result will be an
uppercase character.
A)True
B)False
Q2) This function will return true if its argument is a printable character other than a digit,
letter, or space.
A)isprint
B)ispunct
C)ischar
D)isnotdls
E)None of these
To view all questions and flashcards with answers, click on the resource link above.
Chapter 11: Structured Data
Available Study Resources on Quizplus for this Chatper
53 Verified Questions
53 Flashcards
Source URL: https://quizplus.com/quiz/30145
Sample Questions
Q1) You cannot directly assign an enumerator to an int variable.
A)True
B)False
Q2) Any mathematical operations that can be performed on regular C++ variables can
be performed on structure members.
A)True
B)False
Q4) When you use a strongly typed enumerator in C++ 11, you must prefix the
enumerator with the name of the enum, followed by the :: operator.
A)True
B)False
To view all questions and flashcards with answers, click on the resource link above.
Page 13
Chapter 12: Advanced File Operations
Available Study Resources on Quizplus for this Chatper
38 Verified Questions
38 Flashcards
Source URL: https://quizplus.com/quiz/30146
Sample Questions
Q1) When used by itself, this access flag causes a file's contents to be deleted if the file
already exists.
A)ios::app
B)ios::in
C)ios::out
D)All of these
E)None of these
Q2) Which statement opens a file and links it to a file stream object?
A)open(aFile)= link(anObject);
B)file.open("c:\\filename.txt");
C)linkstream("filename.txt");
D)link(open(filename.txt"));
E)None of these
Q3) This data type can be used to create files and write information to them but cannot
be used to read information from them.
A)ofstream
B)ifstream
C)afstream
D)outstream
E)None of these
To view all questions and flashcards with answers, click on the resource link above.
Page 14
Chapter 13: Introduction to Classes
Available Study Resources on Quizplus for this Chatper
47 Verified Questions
47 Flashcards
Source URL: https://quizplus.com/quiz/30147
Sample Questions
Q1) Assume that myCar is an instance of the Car class, and that the Car class has a
member function named accelerate. Which of the following is a valid call to the
accelerate member function?
A)Car->accelerate();
B)myCar::accelerate();
C)myCar.accelerate();
D)myCar:accelerate();
Q3) When using smart pointers to dynamically allocate objects in C++ 11, it is
unnecessary to delete the dynamically allocated objects because the smart pointer will
automatically delete them.
A)True
B)False
To view all questions and flashcards with answers, click on the resource link above.
Page 15
Chapter 14: More About Classes
Available Study Resources on Quizplus for this Chatper
40 Verified Questions
40 Flashcards
Source URL: https://quizplus.com/quiz/30148
Sample Questions
Q1) If you overload the prefix ++ operator, the postfix ++ operator is automatically
overloaded.
A)True
B)False
Q2) When objects contain pointers, it is a good idea to create an explicit ________
function.
A)destructor
B)copy constructor
C)static constructor
D)inline constructor
E)None of these
To view all questions and flashcards withPage 16 click on the resource link above.
answers,
Chapter 15: Inheritance, Polymorphism, and Virtual
Functions
Available Study Resources on Quizplus for this Chatper
40 Verified Questions
40 Flashcards
Source URL: https://quizplus.com/quiz/30149
Sample Questions
Q1) The base class access specification determines how ________ members in the
base class may be accessed by derived classes.
A)private
B)public
C)protected
D)A, B, and C
E)None of these
Q3) ________ to a base class may be assigned the address of a derived class object.
A)Access specifiers
B)Static members
C)Private members
D)Pointers
E)None of these
Page 17
To view all questions and flashcards with answers, click on the resource link above.
Chapter 16: Exceptions, Templates, and the Standard
Sample Questions
Q1) A sequence container organizes data in a sequential fashion, similar to an array.
A)True
B)False
Q2) The ________ starts with the key word try, and is followed by a block of code
executing any statements that might cause an exception to be thrown.
A)try block
B)try/catch class
C)try()function
D)catch()function
E)None of these
Q4) The line containing a throw statement is known as the throw point.
A)True
B)False
Page 18
To view all questions and flashcards with answers, click on the resource link above.
Chapter 17: Linked Lists
Available Study Resources on Quizplus for this Chatper
40 Verified Questions
40 Flashcards
Source URL: https://quizplus.com/quiz/30151
Sample Questions
Q1) Appending a node means adding it to the end of a list, and ________ a node
means putting a new node in the list, but not necessarily at the end.
A)concatenating
B)popping
C)clamping
D)inserting
E)None of these
Q3) A new node must always be made the last node in the list.
A)True
B)False
Q4) Linked lists are less complex to code and manage than arrays.
A)True
B)False
To view all questions and flashcards with answers, click on the resource link above.
Page 19
Chapter 18: Stacks and Queues
Available Study Resources on Quizplus for this Chatper
47 Verified Questions
47 Flashcards
Source URL: https://quizplus.com/quiz/30152
Sample Questions
Q1) A stack has two primary operations:
A)push and pull
B)push and pop
C)insert and delete
D)append and delete
E)None of these
Q2) ________ queues are more intuitive and easier to understand than ________
queues.
A)Static, dynamic
B)Dynamic, static
C)Deque-like, stack-like
D)Stack-like, deque-like
E)None of these
Q3) If data is transmitted faster than it can be processed, it can be held in a ________
for processing.
A)stack
B)queue
C)static array
D)static deque
E)None of these
To view all questions and flashcards with answers, click on the resource link above.
Page 20
Chapter 19: Recursion
Available Study Resources on Quizplus for this Chatper
22 Verified Questions
22 Flashcards
Source URL: https://quizplus.com/quiz/30153
Sample Questions
Q1) The QuickSort algorithm was developed in 1960 by ________.
A)Bjarne Stroustrup
B)Tony Gaddis
C)C.A.R. Hoare
D)C.M. Turner
E)None of these
Q2) When recursion is used on a linked list, it will always display the contents of the list in
reverse order.
A)True
B)False
Q3) The ________ of recursion is the number of times a recursive function calls itself.
A)level
B)breadth
C)type
D)depth
E)None of these
To view all questions and flashcards with answers, click on the resource link above.
Page 21
Chapter 20: Binary Trees
Available Study Resources on Quizplus for this Chatper
38 Verified Questions
38 Flashcards
Source URL: https://quizplus.com/quiz/30155
Sample Questions
Q1) The ________ in a binary tree is similar to the head pointer in a linked list.
A)root pointer
B)leaf pointer
C)null pointer
D)binary pointer
E)None of these
To view all questions and flashcards with answers, click on the resource link above.
Page 22