Search Header Logo

Test Questions

Authored by Code Marathon

Computers

12th Grade

Used 3+ times

Test Questions
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

1. What is the purpose of a pure virtual function in C++?

a) To ensure that the function is never called
b) To provide a default implementation for derived classes
c) To make a class abstract and require derived classes to implement it
d) To enable function overloading

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

2. In C++, what is the difference between an object and a class?

a) An object is a blueprint for creating instances of a class.
b) An object is an instance of a class, and a class is a blueprint.
c) An object is a function inside a class, and a class is an instance of the object.
d) An object and a class are the same thing in C++.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

3. Which of the following is not a C++ standard library container?

a) vector
b) queue
c) array
d) stack

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

4. What is the purpose of the 'new' operator in C++?

a) To delete memory allocated by the 'malloc' function
b) To allocate memory for an array of elements
c) To create a new instance of a class
d) To open a new file for reading

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

5. In C++, what is the role of the 'typeid' operator?

a) It returns the type information of a variable or expression.
b) It checks if a variable is of primitive type.
c) It is used to cast variables to a different type.
d) It is used to determine the size of an array.

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?