
C++ Polymorphism Quiz

Quiz
•
Other
•
University
•
Hard
Justine Nichol Pasamonte
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which of the following best illustrates runtime polymorphism in C++?
Two functions named print() with different parameter types
A virtual method overridden in a derived class and called through a base class pointer
Overloading the + operator to add matrices
Defining multiple constructors in a class
2.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which condition must be met for function overriding to achieve runtime polymorphism in C++?
The derived function must have default parameters
The base class function must be declared with the virtual keyword
Both base and derived class functions must be private
Function names must differ across classes
3.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What distinguishes operator overloading from function overriding in C++?
Operator overloading changes behavior based on operand types at compile time, while function overriding changes behavior at runtime
Operator overloading is only applicable to arithmetic operators
Function overriding does not support inheritance
Operator overloading uses the virtual keyword
4.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which of the following correctly explains why compile-time polymorphism executes faster than runtime polymorphism?
It uses inline assembly optimization
The compiler completely eliminates function calls
The function binding is resolved during compilation
It avoids object-oriented features
5.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What enables polymorphic behavior when calling a function through a base class reference?
The function must be overloaded
The base class must be abstract
The base class function must be declared virtual
The function must return void
6.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What is a limitation of compile-time polymorphism in C++?
It doesn't allow operator overloading
It cannot resolve behavior based on actual object type at runtime
It cannot use static binding
It depends on the use of pointers
7.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which of the following pairs represent only runtime polymorphism techniques?
Function overloading and inheritance
Function overriding and operator overloading
Templates and overloaded constructors
Virtual functions and overridden methods
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Java programming

Quiz
•
University
20 questions
MSDS

Quiz
•
University
18 questions
MIDTERM EXAM

Quiz
•
University
10 questions
Ingeniería de Software programación Orientada a Objetos

Quiz
•
University
10 questions
Kuis TM1& 2 ABO

Quiz
•
University
10 questions
C++ set 3

Quiz
•
University
20 questions
SET 2 quiz

Quiz
•
University
10 questions
SKEM4133 MVS 2324-1 Topic 5

Quiz
•
University
Popular Resources on Wayground
12 questions
Unit Zero lesson 2 cafeteria

Lesson
•
9th - 12th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
20 questions
Lab Safety and Equipment

Quiz
•
8th Grade
13 questions
25-26 Behavior Expectations Matrix

Quiz
•
9th - 12th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Other
15 questions
Let's Take a Poll...

Quiz
•
9th Grade - University
2 questions
Pronouncing Names Correctly

Quiz
•
University
12 questions
Civil War

Quiz
•
8th Grade - University
18 questions
Parent Functions

Quiz
•
9th Grade - University
21 questions
Mapa países hispanohablantes

Quiz
•
1st Grade - University
19 questions
Primary v. Secondary Sources

Quiz
•
6th Grade - University
25 questions
Identifying Parts of Speech

Quiz
•
8th Grade - University
20 questions
Disney Trivia

Quiz
•
University