Search Header Logo

OOP2023_P1_B9A_March28

Authored by MR ARORA

Computers

University

Used 1+ times

OOP2023_P1_B9A_March28
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

20 sec • 1 pt

Which of the following is a limitation of using friend functions in C++?

They can access private members of the class

They can be called from anywhere in the program

They cannot be overloaded

They can lead to less secure code if used improperly.

2.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What is the purpose of constructors in C++?

To allocate memory for objects

To initialize the data members of objects

To deallocate memory for objects

To create new objects

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following is true about constant objects in C++?

The member functions of a constant object can modify the object.

A constant object cannot be used as an argument to a non-const member function.

The data members of a constant object can be modified.

A constant object can be created only with a parameterized constructor.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Default Constructor

Parameterized Constructor: 10

Destructor

Parameterized Constructor: 5

Destructor

Default Constructor

Parameterized Constructor: 10

Destructor

Destructor

Parameterized Constructor: 5

Destructor

Default Constructor

Parameterized Constructor: 10

Parameterized Constructor: 5

Destructor

Destructor

Destructor

Default Constructor

Parameterized Constructor: 10

Destructor

Parameterized Constructor: 5

Destructor

Destructor

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following is a disadvantage of using friend functions in C++?

It violates encapsulation

It makes the code difficult to read

It makes the code less efficient

None of the above

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?