Week 1 Session 1
Week 1 Session 1
Programming (OOP)
Contents
2
• Machine language
• Unstructured programming languages
• Procedural programming languages
• Structured oriented programming languages
• Object oriented programming languages
Procedural Structured
Unstructured Object oriented
programming programming
Machine programming programming
languages languages
Language languages languages
e.g. FORTRAN, e.g. C and
e.g. assembly e.g. C++ JAVA
COBOL PASCAL
Overview of programming language types and levels
7
Machine language
8
• Assembly language is the more than low level and less than high-
level language so it is intermediary language.
In machine language data only represented with the help In assembly language data can be represented with the
of binary format(0s and 1s), hexadecimal and octadecimal. help of mnemonics such as Mov, Add, Sub, End etc.
Machine language is very difficult to understand by the Assembly language is easy to understand by the human
human beings. being as compare to machine language.
Modifications and error fixing cannot be done in machine Modifications and error fixing can be done in assembly
language. language.
Machine language is very difficult to memorize so it is not Easy to memorize the assembly language because some
possible to learn the machine language. alphabets and mnemonics are used.
Execution is fast in machine language because all data is Execution is slow as compared to machine language.
already present in binary format.
There is no need of translator.The machine understandable Assembler is used as translator to convert mnemonics into
form is the machine language. machine understandable form.
Machine language is hardware dependent. Assembly language is the machine dependent and it is not
portable.
Unstructured programming languages
12
Limitations
• Data is global and code operate on it.
• The importance is given to the operation rather than the data, which
might pose issues in some data-sensitive cases.
• Data is not secured because data is global and can be accessed by any
function.
Structured programming languages
17
• Data moves freely around the systems from one function to another.
Structured programming languages
18
Limitations
• Data hiding
• Debugging of program is hard
• Not possible to handle run time errors and future
enhancements
• Software development period and cost is high
• If end user require changes, a big modification is needed in
software
• More stress laid on procedures not on data
Object oriented programming languages
20
• The main aim of OOP is to bind together the data and the
functions that operate on them so that no other part of
the code can access this data except that function.
Object oriented programming languages
22
Procedure/Structure oriented
Object oriented
Bottom-up.
Top-down.
Main focus is on 'data security'. Hence, only objects are
Main focus is on "how to get the task done" i.e. on the permitted to access the entities of a class.
procedure or structure of a program .
Large program is divided into units called functions. Entire program is divided into objects.
Procedure/Structure oriented
Object oriented
Inheritance achieved in three modes public private and
Their is no provision of inheritance. protected.
There is no proper way of hiding the data, so data is Data is hidden in three modes public, private, and
insecure protected. hence data security increases.
Data is shared among the objects through the member
Global data is shared among the functions in the functions.
program.
Classes or function can become a friend of another
class with the keyword "friend".
No concept of friend function.
Note: "friend" keyword is used only in c++
Attributes
(instance variable / information / property / characteristic / field and
state) are the attributes of the object, - Characteristics of certain
object.
Example
29
Why OOP?
30
• https://www.geeksforgeeks.org/classes-objects-java/
• https://
techdifferences.com/difference-between-oop-and-pop.html
• https://www.educative.io/blog/object-oriented-programming
• https://www.geeksforgeeks.org/difference-between-machine-lan
guage-and-assembly-language
/
• https://www.learncomputerscienceonline.com/computer-progra
mming/#
POST2anchor2
35
THANK YOU
36
Next
Introduction to Java, NetBeans IDE, basic
program, syntax, first program with use of
class, object, attribute and method