0% found this document useful (0 votes)
4 views

Ch. - 01. Principles of Object Oriented Programming(Part I)-1

The document covers the principles of Object Oriented Programming (OOP) including key concepts such as data abstraction, encapsulation, inheritance, and polymorphism. It contrasts OOP with Procedure Oriented Programming (POP) and discusses the characteristics of high-level and low-level languages, as well as compilers and interpreters. Additionally, it includes true/false statements and subjective questions to reinforce understanding of these programming concepts.

Uploaded by

vedu yo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Ch. - 01. Principles of Object Oriented Programming(Part I)-1

The document covers the principles of Object Oriented Programming (OOP) including key concepts such as data abstraction, encapsulation, inheritance, and polymorphism. It contrasts OOP with Procedure Oriented Programming (POP) and discusses the characteristics of high-level and low-level languages, as well as compilers and interpreters. Additionally, it includes true/false statements and subjective questions to reinforce understanding of these programming concepts.

Uploaded by

vedu yo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Ch. - 01.

Principles of Object Oriented Programming (Part I)


PART A - COMPETENCY FOCUSED QUESTIONS:
II. Fill in the blanks :
1. An act of using essential features without including background details is called __ data abstraction __
2. In an Object Oriented Programming, the stress is given on __ data items __
3. Wrapping of data and function together as a single unit is called __ Encapsulation __
4. An __ object __has unique identity through which it may differ with some characteristics and behaviour.
5. The objects may communicate with each other through __ functions __
6. In POP, the global data are loosely attached to the __ functions __
7. The process by which a class acquires the property of another class is known as __ inheritance __
8. In Object Oriented Programming, using a function for many purposes is termed as __ polymorphism __

III. State whether the given statements are TRUE or FALSE


1. A process according to which a class acquires the characteristics from another class is Encapsulation. false
2. Procedure oriented program stresses on data. false
3. C++ is also an object oriented programming language. true
4. An object is identified by its characteristics. true
5. Function is a set of objects that share the common state and behaviour. true
6. Encapsulation keeps data safe from outside interference. true

PART B - SUBJECTIVE QUESTION:


I. Write short notes with an example (if applicable):
1. Object Oriented Programming
Ans : Object Oriented Programming (OOP) is a modular approach which allows the data to be applied within a
stipulated program area. The main aim of OOP is to bind data and functions together so that no other part of the code
can access this data except that function.

2. Data Abstraction
Ans : Data abstraction is the act of representing the essential features without knowing the background details. It is
always relative to the purpose of the uses.
For example, most of us know to use the essential features of a camera to click and view pictures without knowing its
internal mechanism. Likewise, data abstraction allows us to use certain features in Java without knowing the other
background details.

3. Encapsulation
Ans : The system of wrapping data and functions into a single unit is known as Encapsulation.

4. Machine Language
Ans : Machine language is any low-level programming language with instructions for controlling the CPU. It's a
binary format of 0s and 1s. This form of binary instructions is also called machine code or object code. The computer
understand the machine code easily and execute directly.

5. Polymorphism
Ans : The term Polymorphism is defined as the process of using a functions or method for more than one purpose.
For example, the function name Volume( ) can be used by different functions to calculate the volume of a cube or the
volume of a cuboid etc as follows:
Volume(int s)
{

}
Volume(int l, int b, int h)
{

6. Procedure Oriented Programming


Ans : Procedure oriented programming language focuses on the functions rather than the data. the data values may
keep floating throughout the program in an unrestricted and insecured manner.

Page 1 of 2
7. Inheritance
Ans : Inheritance can be defined as the process where one class acquired the properties of another class. the class
which inherits the properties of the other class is known as sub class (derived class) and the class whose properties are
inherited is known as super class (base class).
For example, consider a class ‘Vehicle’ and another class ‘Car. Assuming that the ‘Vehicle’ class is already available,
the ‘Car’ class can created by reusing many of the features of the ‘Vehicle’ class.
Base class – The existing class whose properties are inherited by another class is called as the Base class/ Super
class/Parent class.
Derived class – The class that acquires the properties from an existing class is known as Derived class/ Subclass/ Child
class.
In the above example, the ‘Vehicle’ class is the Base class and the ‘Car’ class is the Derived class.

8. Assembly Language
Ans : A language, in which the instructions are coded in term of mnemonics and op-codes(or operation codes), is
known as assembly language. the mnemonics are the abbreviated forms of the instructions, used to write a program.
Whereas, op-codes are the numeric codes of the instruction that are actually fed to the computer for execution.
Example, LD A, LD B, ADD A, B, ST C etc.

II. Distinguish between:


1. Object Oriented Programming and Procedure Oriented Programming
Procedure Oriented Programming Object Oriented Programming
 The stress is on the function rather than the data.  The stress is put on data rather than functions.
 It allows the data to flow freely throughout the  The data is restricted to be used in a specific
program program area.
 It follows top-down programming approach.  It follows bottom-up programming approach.

2. High Level Language and Low Level Language


High Level Language Low Level Language
 It is programmer friendly language.  It is a machine friendly language.
 It is a machine independent language.  It is a machine dependent language.
 It is easy to understand.  It is tough to understand.
 The error detection and correction is easier.  The error detection and correction is not easier.

3. Compiler and Interpreter


Compiler Interpreter
 It converts the whole source program into the  It convert the source program into the object
object program all at once. program one line at a time.
 It display the errors for the complete program  It display the errors, one line at a time and only
together after the compilation. after debugging that error does the control shift to
the next line.

Page 2 of 2

You might also like