Chapter 1 - Principles of OOP (Object Oriented Programming) Solutions Grade 9 ICSE Computer Textbook exercises solutions
Principles of Object Oriented Programming
Fill in the blanks
An act of using essential features without including background details is called Data Abstraction.
In an Object Oriented Programming, the stress is given on data.
Wrapping of data and function together as a single unit is called Encapsulation.
An object has a unique identity through which it may differ with some characteristics and behaviour.
The objects may communicate with each other through function.
In POP, the global data is loosely attached to the function.
The process by which a class acquires the property of another class is known as inheritance.
In Object Oriented Programming, using a function for many \purposes is termed as polymorphism.
__________________________________________________________
II. State whether the given statements are TRUE or FALSE
In assembly level language, the instructions are given in terms of 0's and 1's. = False
PASCAL is a structure oriented programming language.= True
Machine level language requires a translator to convert input instructions to be understood by the machine. = False
Compilers and Interpreters are referred to as Language processors. = True
A process according to which a class acquires the characteristics from another class is Encapsulation. = False
Procedure oriented program stresses on data. = False
C++ is also an object oriented programming language. = True
An object is identified by its characteristics. = True
Function is a set of objects that share the common state and behaviour. = False
Encapsulation keeps data safe from outside interference. = True
__________________________________________________________
III. Name the following
Two categories of Low Level languages
Assembly Language
Machine Language
Two Procedure Oriented Languages
BASIC
COBOL
Two structure oriented programming languages
PASCAL
ALGOL
Two examples of Data Abstraction in your daily life
Electrical Switchboard
ATM
Two examples of real world objects
Television
Car
Two basic principles of Object Oriented Programming
Encapsulation
Inheritance
__________________________________________________________
IV. Write short notes
Object Oriented Programming = Object Oriented Programming is an approach in which stress is laid on data rather than functions. The data values remain associated with the functions of a particular block of the program so as to encourage data security.
Data Abstraction = Data Abstraction is the act of representing the essential features without knowing the background details.
Encapsulation = Wrapping of data and functions that operate on that data into a single unit is called Encapsulation.
Machine Level language = For the processor to perform any computation, we need to give the instructions and data as a sequence of 0's & 1's. This binary sequence that a processor understands is known as its Machine Level language. Machine Level language is made up of instructions and data that are all binary numbers. Machine Level language of a processor differs from vendor to vendor. So programs written in Machine Level language of one type of processor will not work on a different type of processor.
Polymorphism = In object-oriented programming, Polymorphism provides the means to perform a single action in multiple different ways.
Procedure Oriented Programming = Procedure Oriented Programming basically consists of a list of instructions for the computer to follow and these are organized into groups known as functions. In Procedure Oriented Programming, most of the functions share global data and this data moves more openly around the system from one function to the other.
Inheritance = Inheritance enables new classes to receive or inherit the properties and methods of existing classes.
Assembly Level language = In Assembly Level language, instructions are written in more english like words knowns as mnemonics. These instructions are not understood by the processor directly. They are converted into equivalent Machine Level instructions through a translator program called Assembler. Assembly Level language is machine dependent that makes it unsuitable for writing portable programs that can execute across machines.
______________________________________________________
V. Distinguish between
Object Oriented Programming and Procedure Oriented Programming
High Level language and Low Level language
Compiler and Interpreter
____________________________________________________
VI. Answer the following questions
Enlist the features of Object Oriented Programming.
Some of the features of Object Oriented Programming are:
It gives stress on data items rather than functions.
It makes the complete program/problem simpler by dividing it into a number of objects.
The objects can be used as a bridge to have data flow from one function to another.
The concept of data hiding enhances security in programs.
It is highly beneficial to solve complex programs.
Which OOP principle implements function overloading? Explain
Polymorphism implements function overloading. It is the process of using a function/method for more than one purpose. In function overloading, we write more than one function with the same name but differing in the number and types of their arguments to perform different tasks. This way we get different behaviours using the same function name.
Write three benefits of Object Oriented Programming.
Three benefits of Object Oriented Programming are:
The reusability of the program code is enhanced.
Data abstraction makes the software easier to handle.
Software for complex tasks can be easily developed.
Mention two limitations of:
(a) Procedure Oriented Programming
No restriction on data values so managing changes is difficult as it impacts the entire program.
No reusability concept hence time management, testing and length of the program increases.
(b) Object Oriented Programming
Requires intensive testing processes.
Solving problems takes more time as compared to Procedure Oriented Programming.
How is Encapsulation useful in Object Oriented Programming? Explain
Encapsulation restricts the free flow of data from one object to another. The data and functions are wrapped together in an object in such a way that the data of a particular object can only be used in associated functions. Thus, Encapsulation helps in protecting the data from unauthorised access.
What are the advantages of High Level languages?
High Level languages are machine independent.
High Level languages are human readable as instructions are written using English like words and phrases.
It is easier to understand and develop the program logic in High Level languages.
The error detection and correction is easier.
Comments
Post a Comment