C++ Polymorphism Quiz

C++ Polymorphism Quiz

University

15 Qs

quiz-placeholder

Similar activities

FINANCIAL MANAGEMENT

FINANCIAL MANAGEMENT

12th Grade - University

20 Qs

Quality Engineering

Quality Engineering

University

10 Qs

RISK

RISK

University - Professional Development

13 Qs

SIA WEEK 16

SIA WEEK 16

University

20 Qs

Hypertension

Hypertension

University

15 Qs

Lebaran

Lebaran

10th Grade - University

10 Qs

PLANTS AND THEIR ENVIRONMENT

PLANTS AND THEIR ENVIRONMENT

University

20 Qs

Three-phase Uncontrolled Rectifiers (Part 8)

Three-phase Uncontrolled Rectifiers (Part 8)

University

10 Qs

C++ Polymorphism Quiz

C++ Polymorphism Quiz

Assessment

Quiz

Other

University

Practice Problem

Hard

Created by

Justine Nichol Pasamonte

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?