Chapter 13

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Namma Kalvi V.SUJITHA VIJAYAKUMAR, MCA.,B.Ed.,M.Phil.,PGDCA.

www.nammakalvi.org
Unit - IV CHAPTER - 13
INTRODUCTION TO OOP WITH C++
Part – 1
Choose the best answer

1. The term is used to describe a programming approach based on classes and objects is
(A) OOP (B) POP (C) ADT (D) SOP
2. The paradigm which aims more at procedures.
(A) Object Oriented Programming (B) Procedural programming
(C) Modular programming (D) Structural programming
3. Which of the following is a user defined data type?
(A) class (B) float (C) int (D) object
4. The identifiable entity with some characteristics and behaviour is.
(A) class (B) object (C) structure (D) member
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
6. Insulation of the data from direct access by the program is called as
(A) Data hiding (B) Encapsulation (C) Polymorphism (D) Abstraction
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
8. Which of the following is the most important advantage of inheritance?
(A) data hiding (B) code reusability (C) code modification (D) accessibility
9. “Write once and use it multiple time” can be achieved by
(A) redundancy (B) reusability (C) modification (D) composition
10. Which of the following supports the transitive nature of data?
(A) Inheritance (B) Encapsulation (C) Polymorphism (D) Abstraction

Part –II
Answer to all the questions (2 Marks):
1. How is modular programming different from procedural programming paradigm?
MODULAR PROGRAMMING PROCEDURAL PROGRAMMING
Paradigm consists of multiple modules, each Procedural means a list of instructions were given
module has a set of functions of related types. to the computer to do something. Procedural
Data is hidden under the modules. programming aims more at procedures.
Features: Features:
 Programs are divided into individual modules.  Programs are organized in the form of
 Each modules are independent of each other subroutines or sub programs.
and have their own local data.  All data items are global.

Example: Pascal and C Example: FORTRAN and COBOL.

Sastra Matric.Hr.Sec.School, Kilpennathur, Tiruvannamalai 1


www.nammakalvi.org V.SUJITHA VIJAYAKUMAR, MCA.,B.Ed.,M.Phil.,PGDCA.,

2. Differentiate classes and objects.

CLASS OBJECT

Class is a user defined data type. Class represents Objects are the basic unit of OOP. It represents
a group of similar objects. data and associated function together in to a single
unit.
Objects are share common properties and An identifiable entity with some characteristics
relationship. and behavior.

3. What is polymorphism?

Polymorphism is the ability of a message or function to be displayed in more than one form.
Example:
Draw_square() Draw_circle() Draw_rectangle()

4. How is encapsulation and abstraction are interrelated?

 Abstract attributes are Encapsulate all the essential properties of the object that are to be created.
The attributes are called data members because they hold information.

 Abstraction refers to showing only the essential features without revealing background details.

5. Write the disadvantages of OOP.


Size: Object Oriented Programs are much larger than other programs.
Effort: Object Oriented Programs require a lot of work to create.
Speed: Object Oriented Programs are slower than other programs, because of their size.

Part – III
Answer to all the questions (3 Marks):
1. What is paradigm? Mention the different types of paradigm.
 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,
1. Procedural programming
2. Modular Programming
3. Object Oriented Programming

2. Write a note on the features of procedural programming.


 Programs are organized in the form of subroutines or sub programs
 All data items are global
 Suitable for small sized software application
 Difficult to maintain and enhance the program code as any change in data type needs to be
propagated to all subroutines that use the same data type. This is time consuming.

 Example: FORTRAN and COBOL.

Sastra Matric.Hr.Sec.School, Kilpennathur, Tiruvannamalai 2


www.nammakalvi.org V.SUJITHA VIJAYAKUMAR, MCA.,B.Ed.,M.Phil.,PGDCA.,

3. List some of the features of modular programming.


 Emphasis on algorithm rather than data
 Programs are divided into individual modules
 Each modules are independent of each other and have their own local data
 Modules can work with its own data as well as with the data passed to it.
 Example: Pascal and C

4. What do you mean by modularization and software reuse?

Modularisation: Where the program can be decomposed into modules.


Software re-use: Where a program can be composed from existing and new modules.

5. Define information hiding.


Encapsulation of data from direct access by the program is called data hiding or information
hiding.

Part –IV
Answer to all the questions (5 Marks):

1. Write the differences between Object Oriented Programming and procedural programming.

OBJECT ORIENTED PROGRAMMING PROCEDURAL PROGRAMMING

In OOP where the program can be Programs are organized in the form of
decomposed into modules. subroutines or sub programs.

Data items are global as well as local


(public, private, protected are used). Data All data items are global.
and its associated operations are grouped in
to single unit.

Programs are designed around the data Suitable for small sized software
being operated. application.

Difficult to maintain and enhance the


Relationships can be created between program code as any change in data type
similar, yet distinct data types. needs to be propagated to all subroutines
that use the same data type. This is time
consuming.

Example: C++, Java, VB.Net, Python etc. Example: FORTRAN and COBOL.

Sastra Matric.Hr.Sec.School, Kilpennathur, Tiruvannamalai 3


www.nammakalvi.org V.SUJITHA VIJAYAKUMAR, MCA.,B.Ed.,M.Phil.,PGDCA.,

2. What are the advantages of OOPs?


Advantages of OOP:

1. Re-usability:

“Write once and use it multiple times” you can achieve this by using class.

2. 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.

3. Easy Maintenance:

It is easy to maintain and modify existing code as new objects can be created with small
differences to existing ones.

4. Security:

Using data hiding and abstraction only necessary data will be provided thus maintains the
security of data.

Disadvantages of OOP:

1. Size: Object Oriented Programs are much larger than other programs.
2. Effort: Object Oriented Programs require a lot of work to create.
3. Speed: Object Oriented Programs are slower than other programs, because of their size.

3. Write a note on the basic concepts that support OOPs?

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:

 Modularisation: where the program can be decomposed into modules.


 Software re-use: where a program can be composed from existing and new modules.

Main Features of Object Oriented Programming

 Data Abstraction

 Encapsulation

 Modularity

 Inheritance

 Polymorphism

Sastra Matric.Hr.Sec.School, Kilpennathur, Tiruvannamalai 4


V.SUJITHA VIJAYAKUMAR, MCA.,B.Ed.,M.Phil.,PGDCA.,

1. Encapsulation

The mechanism by which the data and functions are bound together into a single unit is known as
Encapsulation.

This encapsulation of data from direct access by the program is called data hiding or information
hiding.

2. 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.

3. 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.

4. 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.

5. Polymorphism

Polymorphism is the ability of a message or function to be displayed in more than one form.

www.nammakalvi.org

M.VIJAYA KUMAR, MCA.,M.Phil.,B.Ed.,PGDCA., V.SUJITHA, MCA.,M.Phil.,


PGT-COMPUTER TEACHER, PGT-COMPUTER TEACHER,
SASTRA MATRICULATION HIGHER SECONDARY SCHOOL,
KILPENNATHUR, TIRUVANNAMALAI 604601

Additional Question answer with Unit wise


Important Question Bank
Coming Soon….

in
Vijay Guide
Mobile No : 9655826843 Email : [email protected]

Sastra Matric.Hr.Sec.School, Kilpennathur, Tiruvannamalai 5

You might also like