1. Prepared By: Asst. Prof. Sejal Jadav
Unit-1
Principles of Object Oriented Programming Tokens,
expressions & Control Statements
(14 MARKS)
B.C.A & B.Sc.(IT) – 3
CS-13 C++ and Object Oriented
Programming
Prepared By: Asst. Prof. Sejal Jadav
2. Prepared By: Asst. Prof. Sejal Jadav
Procedure Oriented Programming
•Problem is viewed as a sequence of things.
(I.e. Reading, Calculating, and Printing).
•Programs are like a list of instructions
which needs to be executed one by one.
3. Prepared By: Asst. Prof. Sejal Jadav
•Emphasis is given on procedure that is
“How the task can be accomplished”?
•Functions are written to accomplish these
tasks.
•Flowcharts are used to organize the actions
and flow of control.
4. Prepared By: Asst. Prof. Sejal Jadav
• Many important data are placed as global
and can be accessed by all functions.
• COBOL, FORTRAN, and C are procedural
languages.
5. Prepared By: Asst. Prof. Sejal Jadav
Structure of POP
What is Function?
• Organizing
instructions into
the group to
perform certain
task is known as
function.
6. Prepared By: Asst. Prof. Sejal Jadav
Relationship of Data & Functions in POP
7. Prepared By: Asst. Prof. Sejal Jadav
•In a multi-function program we use global
variable to communicate between two functions.
•Global variable can be use by any function at any
time while local variables are only used within
the function.
8. Prepared By: Asst. Prof. Sejal Jadav
•But it creates problem in large program
because we can’t determine which global
variables (data) are used by which function.
•Also global variables are accessed by all the
function so any function can change its value
at any time so all the function will be affected.
9. Prepared By: Asst. Prof. Sejal Jadav
Drawbacks/Limitations of POP
• Data are more in danger [open to successful
attack] to an unplanned [unintentional]
change by a function.
• Because most of the functions share global
data.
10. Prepared By: Asst. Prof. Sejal Jadav
• Difficult to identify which data is used by
which function.
• It does not model real world problems
very well because functions are action
oriented.
11. Prepared By: Asst. Prof. Sejal Jadav
Characteristics of POP
•Emphasis on doing things [algorithm].
•Large programs are divided into small
programs known as functions.
•Most of the functions share global data.
12. Prepared By: Asst. Prof. Sejal Jadav
•Data move freely from one function to
another function.
•Functions transform data from one form to
another [integer to float or double etc.].
•Employs “Top-Down” approach in
program design.