Quiz-1

Hello PrepSter,

If you find any errors in the quiz below kindly comment in the comment section and we will make it our priority to fix it.

Also if you have a better of the solution to the questions, please do comment them below and if we find it better than ours, we will post it in our website.

Question 1

Time: 00:00:00
Which among the following best describes encapsulation?

It is a way of combining various data members into a single unit

It is a way of combining various data members into a single unit

It is a way of combining various member functions into a single unit

It is a way of combining various member functions into a single unit

It is a way of combining various data members and member functions into a single unit which can operate on any data

It is a way of combining various data members and member functions into a single unit which can operate on any data

It is a way of combining various data members and member functions that operate on those data members into a single unit

It is a way of combining various data members and member functions that operate on those data members into a single unit

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 2

Time: 00:00:00
If data members are private, what can we do to access them from the class object?

Create public member functions to access those data members

Create public member functions to access those data members

Create private member functions to access those data members

Create private member functions to access those data members

Create protected member functions to access those data members

Create protected member functions to access those data members

Private data members can never be accessed from outside the class

Private data members can never be accessed from outside the class

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 3

Time: 00:00:00
While using encapsulation, which among the following is possible?

Code modification can be additional overhead

Code modification can be additional overhead

Data member’s data type can be changed without changing any other code

Data member’s data type can be changed without changing any other code

Data member’s type can’t be changed, or whole code have to be changed

Data member’s type can’t be changed, or whole code have to be changed

Member functions can be used to change the data type of data members

Member functions can be used to change the data type of data members

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 4

Time: 00:00:00
Which feature can be implemented using encapsulation?

Inheritance

Inheritance

Abstraction

Abstraction

Polymorphism

Polymorphism

Overloading

Overloading

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
Find which of the following uses encapsulation?

void main(){ int a; void fun( int a=10; cout<

void main(){ int a; void fun( int a=10; cout<

class student{ int a; public: int b;};

class student{ int a; public: int b;};

class student{int a; public: void disp(){ cout<

class student{int a; public: void disp(){ cout<

struct topper{ char name[10]; public : int marks; }

struct topper{ char name[10]; public : int marks; }

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
Encapsulation helps in writing ___________ classes in java

Mutable

Mutable

Abstract

Abstract

Wrapper

Wrapper

Immutable

Immutable

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 7

Time: 00:00:00
How can Encapsulation be achieved ?

Using Access Specifiers

Using Access Specifiers

Using only private members

Using only private members

Using inheritance

Using inheritance

Using Abstraction

Using Abstraction

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
 Which among the following should be encapsulated?

The data which is prone to change is near future

The data which is prone to change is near future

The data prone to change in long terms

The data prone to change in long terms

The data which is intended to be changed

The data which is intended to be changed

The data which belongs to some other class

The data which belongs to some other class

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
Which among the following violates the principle of encapsulation almost always?

Local variables

Local variables

Global variables

Global variables

Public variables

Public variables

Array variables

Array variables

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 10

Time: 00:00:00
Which among the following would destroy the encapsulation mechanism if it was allowed in programming?

Using access declaration for private members of base class

Using access declaration for private members of base class

Using access declaration for public members of base class

Using access declaration for public members of base class

Using access declaration for local variable of main() function

Using access declaration for local variable of main() function

Using access declaration for global variables

Using access declaration for global variables

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]