PART – 1
I. Choose The Correct Answer
Question 1.
The term is used to describe a programming approach based on classes and objects is ……………….
(a) OOP
(b) POP
(c) ADT
(d) SOP
Answer:
(a) OOP
Question 2.
The paradigm which aims more at procedures ……………….
(a) Object Oriented Programming
(b) Procedural programming
(c) Modular programming
(d) Structural programming
Answer:
(b) Procedural programming
Question 3.
Which of the following is a user defined data type?
(a) class
(b) float
(c) int
(d) object
Answer:
(a) class
Question 4.
The identifiable entity with some characteristics and behaviour is ……………….
(a) class
(b) object
(c) structure
(d) member
Answer:
(b) object
Question 5.
The mechanism by which the data and functions are bound together into a single unit is known as ……………….
(a) Inheritance
(b) Encapsulation
(c) Polymorphism
(d) Abstraction
Answer:
(b) Encapsulation
Question 6.
Insulation of the data from direct access by the program is called as ……………….
(a) Data hiding
(b) Encapsulation
(c) Polymorphism
(d) Abstraction
Answer:
(a) Data hiding
Question 7.
Which of the following concept encapsulate all the essential properties of the object that are to be created?
(a) Class
(b) Encapsulation
(c) Polymorphism
(d) Abstraction
Answer:
(d) Abstraction
Question 8.
Which of the following is the most important advantage of inheritance?
(a) data hiding
(b) code reusability
(c) code modification
(d) accessibility
Answer:
(b) code reusability
Question 9.
“Write once and use it multiple time” can be achieved by ……………….
(a) redundancy
(b) reusability
(c) modification
(d) composition
Answer:
(b) reusability
Question 10.
Which of the following supports the transitive nature of data?
(a) Inheritance
(b) Encapsulation
(c) Polymorphism
(d) Abstraction
Answer:
(a) Inheritance
PART – 2
II. Answers to all the questions
Question 1.
How is modular programming different from procedural programming paradigm?
Answer:
Modular programming:
Procedural programming:
Question 2.
Differentiate classes and objects.
Answer:
Class:
Object:
Question 3.
What is polymorphism?
Answer:
Polymorphism is the ability of a message or function to be displayed in more than one form.
Question 4.
How is encapsulation and abstraction are interrelated?
Answer:
Abstraction means giving only essential things and hiding unnecessary details. Encapsulation is the binding of data members and methods together in a capsule to avoid accidental changes to data from external users, i.e., encapsulation is the bundling of related algorithms and data.
Question 5.
Write the disadvantages of OOP.
Answer:
PART – 3
III. Answers to all the questions
Question 1.
What is paradigm? Mention the different types of paradigm.
Answer:
Paradigm means organizing principle of a program. It is an approach to programming. There are different approaches available for problem solving using computer. They are Procedural programming, Modular Programming and Object Oriented Programming.
Question 2.
Write a note on the features of procedural programming.
Answer:
Important features of procedural programming
Question 3.
List some of the features of modular programming.
Answer:
Important features of Modular programming:
Question 4.
What do you mean by modularization and software reuse?
Answer:
Question 5.
Define information hiding.
Answer:
Encapsulation is the most striking feature of a class. The data is not accessible to the outside world, and only those functions which are wrapped in the class can access it. This encapsulation of data from direct access by the program is called data hiding or information hiding.
PART – 4
IV. Answers to all the questions
Question 1.
Write the differences between Object Oriented Programming and Procedural Programming
Answer:
Object Oriented Programming:
Procedural Programming:
Question 2.
What are the advantages of OOPs?
Answer:
Re – usability : “Write once and use it multiple times” you can achieve this by using class. Redundancy: Inheritance is the good feature for data redundancy. If you need a same functionality in multiple class you can write a common class for the same functionality and inherit that class to sub class.
Easy Maintenance : It is easy to maintain and modify existing code as new objects can be created with small differences to existing ones.
Security : Using data hiding and abstraction only necessary data will be provided thus maintains the security of data.
Question 3.
Write a note on the basic concepts that supports OOPs?
Answer:
The Object Oriented Programming has been developed to overcome the drawbacks of procedural and modular programming. It is widely accepted that object – oriented programming is the most important and powerful way of creating software.
The Object – Oriented Programming approach mainly encourages:
Main Features of Object Oriented Programming:
Encapsulation:
The mechanism by which the data and functions are bound together into a single unit is known as Encapsulation. It implements abstraction. Encapsulation is about binding the data variables and functions together in class. It can also be called data binding. Encapsulation is the most striking feature of a class.
The data is not accessible to the outside world, and only those functions which are wrapped in the class can access it. These functions provide the interface between the object’s data and the program. This encapsulation of data from direct access by the program is called data hiding or information hiding.
Data Abstraction:
Abstraction refers to showing only the essential features without revealing background details. Classes use the concept of abstraction to define a list of abstract attributes and function which operate on these attributes. They encapsulate all the essential properties of the object that are to be created. The attributes are called data members because they hold information. The functions that operate on these data are called methods or member function.
Modularity:
Modularity is designing a system that is divided into a set of functional units (named modules) that can be composed into a larger application.
Inheritance:
Inheritance is the technique of building new classes (derived class) from an existing Class (base class). The most important advantage of inheritance is code reusability.
Polymorphism:
Polymorphism is the ability of a message or function to be displayed in more than one form.
Additional Questions and Answers
PART – 1
I. Choose the correct answer
Question 1.
In procedural programming all data items are ……………….
(a) Cobol
(b) global
(c) fortan
(d) class
Answer:
(b) global
Question 2.
Class represents a group of similar ……………….
(a) objects
(b) modules
(c) arrays
(d) data
Answer:
(a) objects
Question 3.
………………. is an example of object oriented programming.
(a) Python
(b) Java
(c) VB.Net
(d) All the above
Answer:
(d) All the above
Question 4.
………………. refers to showing only the essential features without revealing background details.
(a) Redundancy
(b) Encapsulation
(c) Abstraction
(d) Inheritance
Answer:
(c) Abstraction
Question 5.
………………. is about binding the data variables and functions together in class.
(a) Data abstraction
(b) Modularization
(c) Redundancy
(d) Encapsulation
Answer:
(d) Encapsulation
PART – 2
II. Very Short Answers
Question 1.
What is procedural programming?
Answer:
Procedural means a list of instructions were given to the computer to do something. Procedural programming aims more at procedures. This emphasis on doing things.
Question 2.
What is a class?
Answer:
A Class is a construct in C++ which is used to bind data and its associated function together into a single unit using the encapsulation concept. Class is a user defined data type. Class represents a group of similar objects.
Question 3.
What is modularity?
Answer:
Modularity is designing a system that is divided into a set of functional units (named modules) that can be composed into a larger application.
Question 4.
What are the main features of OOP?
Answer:
Main Features of Object Oriented Programming:
Question 5.
What is redundancy?
Answer:
Inheritance is the good feature for data redundancy. If you need a same functionality in multiple class you can write a common class for the same functionality and inherit that class to sub class.
PART – 3
III. Short Answers
Question 1.
Write about objects.
Answer:
Objects: Represents data and its associated function together into a single unit. Objects are the basic unit of OOP. Basically an object is created from a class. They are instances of class also called as class variables. An identifiable entity with some characteristics and behaviour is called object.
Question 2.
What is Encapsulation and data binding?
Answer:
The mechanism by which the data and functions are bound together into a single unit is known as Encapsulation. Encapsulation is the most striking feature of a class. The data is not accessible to the outside world, and only those functions which are wrapped in the class can access it. These functions provide the interface between the object’s data and the program. This encapsulation of data from direct access by the program is called data hiding or information hiding.
PART – 4
IV. Explain in Detail
Question 1.
Explain about features of object oriented programming.
Answer:
Main Features of Object Oriented Programming
Encapsulation:
1. The mechanism by which the data and functions are bound together into a single unit is known as Encapsulation. It implements abstraction.
2. Encapsulation is about binding the data variables and functions together in class. It can also be called data binding.
3.. Encapsulation is the most striking feature of a class. The data is not accessible to the outside world, and only those functions which are wrapped in the class can access it. These functions provide the interface between the object’s data and the program. This encapsulation of data from direct access by the program is called data hiding or information hiding.
Data Abstraction:
Abstraction refers to showing only the essential features without revealing background details. Classes use the concept of abstraction to define a list of abstract attributes and function which operate on these attributes.
They encapsulate all the essential properties of the object that are to be created. The attributes are called data members because they hold information. The functions that operate on these data are called methods or member function.
Modularity:
Modularity is designing a system that is divided into a set of functional units (named modules) that can be composed into a larger application.
Inheritance:
Inheritance is the technique of building new classes (derived class) from an existing Class (base class). The most important advantage of inheritance is code reusability.
Polymorphism:
Polymorphism is the ability of a message or function to be displayed in more than one form.