0% found this document useful (0 votes)
39 views22 pages

Programming in C++ MCQ PDF

The document is a comprehensive MCQ PDF for a Programming in C++ course, covering 20 chapters and 891 verified questions. It includes fundamental and advanced topics in C++, such as syntax, object-oriented programming, memory management, and the Standard Template Library. Additionally, it provides sample questions and flashcards for each chapter to aid in studying and understanding the material.

Uploaded by

zsxrq3zdjc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views22 pages

Programming in C++ MCQ PDF

The document is a comprehensive MCQ PDF for a Programming in C++ course, covering 20 chapters and 891 verified questions. It includes fundamental and advanced topics in C++, such as syntax, object-oriented programming, memory management, and the Standard Template Library. Additionally, it provides sample questions and flashcards for each chapter to aid in studying and understanding the material.

Uploaded by

zsxrq3zdjc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

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

used programming languages in software development. The course covers the

fundamentals of C++ syntax, including variables, data types, control structures,

functions, and object-oriented programming concepts such as classes, inheritance,

polymorphism, and encapsulation. Students will develop the ability to design and

implement efficient, maintainable, and robust code by working through real-world

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

complex programming challenges in C++.

Recommended Textbook
Starting Out with C++ from Control Structures to Objects 8th Edition by Tony Gaddis

Available Study Resources on Quizplus


20 Chapters
891 Verified Questions
891 Flashcards
Source URL: https://quizplus.com/study-set/1523

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

Q2) What does the term hardware refer to?


A)The relative difficulty of programming
B)The physical components that a computer is made of
C)The way a computer's storage space is organized
D)The logical flow of instructions
E)None of the above.
Answer: B

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

Q3) Escape sequences are always stored internally as a single character.


A)True
B)False
Answer: True

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

Q2) When an if statement is placed within the conditionally-executed code of another if


statement, this is known as:
A)complexity
B)overloading
C)nesting
D)validation
E)None of these

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

Q4) An output file is a file that data is written to.


A)True
B)False

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

Q2) Local variables are initialized to zero by default.


A)True
B)False

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

Q3) This vector function returns the number of elements in a vector.


A)size
B)num_elements
C)elements
D)length

Q4) C++ limits the number of array dimensions to two.


A)True
B)False

Q5) An array initialization list must be placed on one single line.


A)True
B)False

To view all questions and flashcards with Page


answers,
9 click on the resource link above.
Chapter 8: Searching and Sorting Arrays
Available Study Resources on Quizplus for this Chatper
20 Verified Questions
20 Flashcards
Source URL: https://quizplus.com/quiz/30161

Sample Questions
Q1) The advantage of a linear search is its ________.
A)complexity
B)efficiency
C)simplicity
D)speed
E)None of these

Q2) The ________ is adequate for searching through small arrays.


A)binary search
B)linear search
C)unary search
D)bubble sort
E)None of these

Q3) A binary search begins with the ________ element of an array.


A)first
B)last
C)largest
D)middle
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

Q3) The strcpy function's arguments are:


A)two C-strings
B)two addresses
C)three pointers
D)one array and one pointer
E)None of these

Q4) The ftoa function converts a floating-point value to an ASCII value.


A)True
Page 12
B)False

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

Q3) The name of the structure is referred to as its ________.


A)data type
B)argument
C)parameter
D)tag
E)None of these

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();

Q2) In a procedural program, you typically have ________ stored in a collection of


variables, and a set of ________ that perform operations on the data.
A)numbers, arguments
B)parameters, arguments
C)strings, operators
D)data, functions
E)None of these

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

Q3) A public data member may be declared a friend of a private function.


A)True
B)False

Q4) An ________ operator can work with programmer-defined data types.


A)inline
B)unconditional
C)overloaded
D)undefined
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

Q2) ________ allows us to create new classes based on existing classes.


A)Polymorphism
B)Inheritance
C)Function overloading
D)The copy constructor
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

Template Library Stl


Available Study Resources on Quizplus for this Chatper
39 Verified Questions
39 Flashcards
Source URL: https://quizplus.com/quiz/30150

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

Q3) A(n)________ is a value or an object that signals an error.


A)destructor
B)template
C)throw
D)exception
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

Q2) To create a linked list, you must first create a(n)________.


A)header file
B)function template
C)exception
D)struct
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

Q4) Recursive algorithms are less efficient than iterative algorithms.


A)True
B)False

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

Q2) Methods of traversing a binary tree are:


A)inorder traversal
B)preorder traversal
C)postorder traversal
D)All of these
E)None of these

Q3) Binary trees can be divided into:


A)branches
B)leaves
C)subtrees
D)sawdust
E)None of these

To view all questions and flashcards with answers, click on the resource link above.

Page 22

You might also like