Select the appropriate answer. 1. Which of the following is the most accurate description of encapsulation? a) It's a method of integrating many data elements into a single unit. b) Its a technique for integrating many member functions into a single unit. c) It's a method of integrating different data members and member functions into a single unit that can work with any data. d) It's a way of combining several data members and member functions into a single unit that can handle any data. 2. What can we do to get data members from the class object if they are private? a) To gain access to such data members, create public member functions. b) To have access to such data members, create private member functions. c) To gain access to certain data members, create protected member functions. d) Members of private data are never accessible from outside the class. 3. Which of the following is achievable when utilizing encapsulation? a) Modifications to the code might add to the workload. b) The data type of a data member can be modified without affecting any other code. c) The type of a data member cannot be changed without changing the entire code. d) The data type of data members can be changed using member functions. 4. Which of the following is an example of encapsulation? a) void main(){ int a; void fun( int a=10; cout<

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Select the appropriate answer.

1. Which of the following is the most accurate description of encapsulation?

a) It's a method of integrating many data elements into a single unit.
b) Its a technique for integrating many member functions into a single unit.
c) It's a method of integrating different data members and member functions into a single unit that can work with any data.
d) It's a way of combining several data members and member functions into a single unit that can handle any data.

2. What can we do to get data members from the class object if they are private?
a) To gain access to such data members, create public member functions.
b) To have access to such data members, create private member functions.
c) To gain access to certain data members, create protected member functions.

d) Members of private data are never accessible from outside the class.

3. Which of the following is achievable when utilizing encapsulation?

a) Modifications to the code might add to the workload.
b) The data type of a data member can be modified without affecting any other code.
c) The type of a data member cannot be changed without changing the entire code.
d) The data type of data members can be changed using member functions.

4. Which of the following is an example of encapsulation?
a) void main(){ int a; void fun( int a=10; cout<<a); fun(); }
b) class student{ int a; public: int b;};
c) class student{int a; public: void disp(){ cout<<a;} };
d) struct topper{ char name[10]; public : int marks; }

5. Which of the following statements most accurately represents constructor overloading?
a) Defining one constructor in each class of a program
b) Defining more than one constructor in single class
c) Defining more than one constructor in single class with different signature
d) Defining destructor with each constructor

Which of the following statements about constructors is false?
a) Constructors doesn’t have a return value
b) Constructors are always user-defined
c) Constructors are overloaded with different signature
d) Constructors may or may not have any arguments being accepted

7. Why do we utilize constructor overloading in the first place?

a) To use different types of constructors
b) because it’s a feature provided
c) To initialize the object in different ways
d) To differentiate one constructor from another

8. Which aspect of OOP is employed here if a function may execute more than one type of work while keeping the function name the same?
a) Encapsulation
b) Inheritance
c) Polymorphism
d) Abstraction

9. The following code demonstrates which OOP feature?

class student{  int marks;  };

class topper: public student{  int age;  topper(int age){ this.age=age; } };

a) Inheritance
b) Polymorphism
c) Inheritance and polymorphism
d) Encapsulation and Inheritance

10. ___________ Feature of Polymorphism in a class is highlighted.

a) Nested class
b) Enclosing class
c) Inline function
d) Virtual Function

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education