Object Oriented Programming Using C Plus Plus — Part 2 MCQs with Explanations
Practice high-yield Computer Science & IT MCQs on Object Oriented Programming Using C Plus Plus — Part 2 with worked academic solutions for PPSC, FPSC, CSS, PMS, NTS.
Questions
40
Difficulty Level
Exam-Level
Target Exams
PPSC, FPSC, CSS...
Estimated Time
48 mins
Exam-Level PPSC FPSC CSS PMS NTS
Verified for Commission Syllabus • Oct 14, 2026
40
Verified Practice Questions
Interactive test mode with detailed academic worked solutions
Live Progress|0/40 answered
✓0 correct
✗0 wrong
0% score
🎉 Set complete! All 40 questions answered.
Question 1 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Redirection redirects
Correct Answer: Option A — a stream from a file to the screen
Detailed Academic Explanation:
a stream from a file to the screen is the correct answer to “Redirection redirects”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 2 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
You mark the beginning of a function's block of code with the _____
Correct Answer: Option C — {
Detailed Academic Explanation:
{ is the correct answer to “You mark the beginning of a function's block of code with the _____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 3 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Sending a copy of data to a program module is called _______
Correct Answer: Option A — passing a value
Detailed Academic Explanation:
passing a value is the correct answer to “Sending a copy of data to a program module is called _______”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 4 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Of the three ways to pass arguments to functions, only passing by _____ and passing by _____ allow the function to modify the argument in the calling program
Correct Answer: Option A — reference, pointer
Detailed Academic Explanation:
reference, pointer is the correct answer to “Of the three ways to pass arguments to functions, only passing by _____ and passing by _____ allow the function to modify the argument in the calling program”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 5 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
To use either an input or output file, the program must include the _____ header file
Correct Answer: Option B — fstream.h
Detailed Academic Explanation:
fstream.h is the correct answer to “To use either an input or output file, the program must include the _____ header file”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 6 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
A widget is to the blueprint for a widget as an object is to
Correct Answer: Option B — a class
Detailed Academic Explanation:
a class is the correct answer to “A widget is to the blueprint for a widget as an object is to”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 7 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
C++ allows you to define the same functions more than once in the same program _____
Correct Answer: Option D — C++ does not allow you to define the same functions more than once in the same program
Detailed Academic Explanation:
C++ does not allow you to define the same functions more than once in the same program is the correct answer to “C++ allows you to define the same functions more than once in the same program _____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 8 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following assigns the number 5 to the area variable?
Correct Answer: Option B — area = 5
Detailed Academic Explanation:
area = 5 is the correct answer to “Which of the following assigns the number 5 to the area variable”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 9 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
A base class may also be called a
Correct Answer: Option D — parent class
Detailed Academic Explanation:
parent class is the correct answer to “A base class may also be called a”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 10 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The _____ mode tells C++ to open a file for input
Correct Answer: Option D — ios::in
Detailed Academic Explanation:
ios::in is the correct answer to “The _____ mode tells C++ to open a file for input”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 11 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Using the wardrobe structure within the ShopList structure is an example of a good programming principle, known as _____
Correct Answer: Option A — reusability
Detailed Academic Explanation:
reusability is the correct answer to “Using the wardrobe structure within the ShopList structure is an example of a good programming principle, known as _____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 12 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
When you omit parameters from a function call, values can be provided by
Correct Answer: Option D — default parameters
Detailed Academic Explanation:
default parameters is the correct answer to “When you omit parameters from a function call, values can be provided by”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 13 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The first element in a string is
Correct Answer: Option B — the first character in the string
Detailed Academic Explanation:
the first character in the string is the correct answer to “The first element in a string is”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 14 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Variables declared outside a block are called _____
Correct Answer: Option A — global
Detailed Academic Explanation:
global is the correct answer to “Variables declared outside a block are called _____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 15 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The compiler converts your C++ instructions into _____
Correct Answer: Option B — object code
Detailed Academic Explanation:
object code is the correct answer to “The compiler converts your C++ instructions into _____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 16 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
A fundamental type such as int or double is a _____
Correct Answer: Option D — scalar type
Detailed Academic Explanation:
scalar type is the correct answer to “A fundamental type such as int or double is a _____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 17 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The return type you code for all constructors is _____
Correct Answer: Option D — no type
Detailed Academic Explanation:
no type is the correct answer to “The return type you code for all constructors is _____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 18 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
When an object-oriented program detects an error within a function, the function _________
Correct Answer: Option A — throws an exception
Detailed Academic Explanation:
throws an exception is the correct answer to “When an object-oriented program detects an error within a function, the function _________”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 19 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Using a statement at the wrong time or with an inappropriate object creates a
Correct Answer: Option A — logical error
Detailed Academic Explanation:
logical error is the correct answer to “Using a statement at the wrong time or with an inappropriate object creates a”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 20 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
When you create a derived class and instantiate an object _____
Correct Answer: Option A — the parent class object must be constructed first
Detailed Academic Explanation:
the parent class object must be constructed first is the correct answer to “When you create a derived class and instantiate an object _____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 21 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
A constructor always has
Correct Answer: Option B — temporal cohesion
Detailed Academic Explanation:
temporal cohesion is the correct answer to “A constructor always has”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 22 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
A normal C++ operator that acts in special ways on newly defined data types is said to be
Correct Answer: Option D — overloaded
Detailed Academic Explanation:
overloaded is the correct answer to “A normal C++ operator that acts in special ways on newly defined data types is said to be”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 23 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
A function in a derived class that has the same name as a function in the parent class
Correct Answer: Option A — will override the base class function
Detailed Academic Explanation:
will override the base class function is the correct answer to “A function in a derived class that has the same name as a function in the parent class”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 24 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
In which statements, does a 'continue' statements cause the control to go directly to the test condition and then continue the looping process?
Correct Answer: Option D — 'while' and 'do-while'
Detailed Academic Explanation:
'while' and 'do-while' is the correct answer to “In which statements, does a 'continue' statements cause the control to go directly to the test condition and then continue the looping process”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 25 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
In a class specifier, data or functions designated private are accessible
Correct Answer: Option C — to member functions of that class
Detailed Academic Explanation:
to member functions of that class is the correct answer to “In a class specifier, data or functions designated private are accessible”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 26 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
When a function includes a throw statement for errors, the call to the potentially offending function should be placed within a _____ block
Correct Answer: Option B — try
Detailed Academic Explanation:
try is the correct answer to “When a function includes a throw statement for errors, the call to the potentially offending function should be placed within a _____ block”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 27 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The scope resolution operator is
Correct Answer: Option D — two colons
Detailed Academic Explanation:
two colons is the correct answer to “The scope resolution operator is”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 28 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
"C++" is a _____ constant
Correct Answer: Option D — string literal
Detailed Academic Explanation:
string literal is the correct answer to “"C++" is a _____ constant”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 29 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
In a C++ program, which of the following can be thrown?
Correct Answer: Option B — programmer-defined objects
Detailed Academic Explanation:
programmer-defined objects is the correct answer to “In a C++ program, which of the following can be thrown”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 30 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The items listed in the function header are called _____
Correct Answer: Option B — formal parameters
Detailed Academic Explanation:
formal parameters is the correct answer to “The items listed in the function header are called _____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 31 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
A translator that notes whether you have used a language correctly may be called a _____
Correct Answer: Option B — compiler
Detailed Academic Explanation:
compiler is the correct answer to “A translator that notes whether you have used a language correctly may be called a _____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 32 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The feature in object-oriented programming that allows the same operation to be carried out differently, depending on the object, is_____
Correct Answer: Option B — polymorphism
Detailed Academic Explanation:
polymorphism is the correct answer to “The feature in object-oriented programming that allows the same operation to be carried out differently, depending on the object, is_____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 33 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
When an argument is passed by reference,
Correct Answer: Option D — the function accesses the argument's original value in the calling program
Detailed Academic Explanation:
the function accesses the argument's original value in the calling program is the correct answer to “When an argument is passed by reference,”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 34 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The process of extracting the relevant attributes of an object is known as
Correct Answer: Option C — abstraction
Detailed Academic Explanation:
abstraction is the correct answer to “The process of extracting the relevant attributes of an object is known as”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 35 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following statements uses the computer's clock to initialize the random number generator?
Correct Answer: Option B — srand(time(NULL))
Detailed Academic Explanation:
srand(time(NULL)) is the correct answer to “Which of the following statements uses the computer's clock to initialize the random number generator”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 36 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
You must provide a constructor for a derived class
Correct Answer: Option B — if the base class constructor required arguments
Detailed Academic Explanation:
if the base class constructor required arguments is the correct answer to “You must provide a constructor for a derived class”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 37 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
If you want to override constructor default values for an object you are instantiating, you must also override
Correct Answer: Option B — all parameters to the left of that value
Detailed Academic Explanation:
all parameters to the left of that value is the correct answer to “If you want to override constructor default values for an object you are instantiating, you must also override”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 38 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
To use one of the C++ built-in mathematical functions, you must include the _____ header file in your program
Correct Answer: Option D — math.h
Detailed Academic Explanation:
math.h is the correct answer to “To use one of the C++ built-in mathematical functions, you must include the _____ header file in your program”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 39 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Errors in a program are called
Correct Answer: Option C — bugs
Detailed Academic Explanation:
bugs is the correct answer to “Errors in a program are called”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 40 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
If you declare two objects as Customer firstCust, secondCust; which of the following must be true?
Correct Answer: Option C — Each object will have a unique memory address
Detailed Academic Explanation:
Each object will have a unique memory address is the correct answer to “If you declare two objects as Customer firstCust, secondCust; which of the following must be true”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
✓Link copied to clipboard
Continue Your Practice
Advanced Mapreduce Concepts — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.