Object-Oriented Programming (OOP) Lecture No. 1: Division of Science and Technology University of Education, Lahore
Object-Oriented Programming (OOP) Lecture No. 1: Division of Science and Technology University of Education, Lahore
(OOP)
Lecture No. 1
• Architectural models
• Mechanical models
Objects - Examples
Why object orientation?
• Procedural Vs OO techniques
• State (attributes)
• Well-defined behavior (operations)
• Unique identity
Example – Ali is a tangible object
• State (attributes)
• Name
• Age
• behaviour (operations)
• Walks
• Eats
• Identity
• His name
Example- Time is an intangible object
• State (attributes)
- Hours - Seconds
- Minutes
• behaviour (operations)
- Set Hours - Set Seconds
- Set Minutes
• Identity
- Would have a unique ID in the model
Example- Date is an intangible object
• State (attributes)
- Year - Day
- Month
• behaviour (operations)
- Set Year - Set Day
- Set Month
• Identity
- Would have a unique ID in the model
Course site link
sites.google.com/view/ueoop
Programming Exercise (Recall)
• Application: Write a program that inputs two numbers and one
arithmetic operator in main function and passes them to a function.
The function applies arithmetic operation on two numbers on the
basis of the operator entered by user (project 137881)
• Codeboard.io
Reference
• C++ How to Program
By Deitel & Deitel
• The C++ Programming Language
By Bjarne Stroustrup
• Object-Oriented Software Engineering
By Jacobson, Christerson, Jonsson, Overgaardocw.vu.edu.pk
• ocw.vu.edu.pk