EE-123 OOP Spring 2017 Lect 1-4
EE-123 OOP Spring 2017 Lect 1-4
Object Oriented
Programming (EE-123)
BY ENGR. SYED ASAD ALI
LECTURER (ELECTRICAL ENGINEERING)-DHA SUFFA UNIVERSITY
2
Points To Ponder
PUNCTUALITY
If any student is late by 5 minutes, (s)he will be marked absent but Allowed to sit in Class.
No quiz/assignment/hourly exam will be retaken if a student was absent.
Late submission leads to a marks deductions
SINCERE TO LEARN (Learn and Let Others to Learn)
Unbearable, taunting and distracting behavior will be dealt strictly and may lead to disciplinary action against
him/her
Student may not be allowed to appear in further classes and exams.
Use of handheld device is prohibited during Lecture and penalized.
Keep phone on Silent and Seek permission to use in case of emergency
BE RESPONSIBLE
Students are responsible to regularly check the announcements (Notice Board, LMS , Class). Failing to do so
cannot be accepted as an excuse.
3
Course synopsis & Books
Objectives:
To familiarize the students with the fundamental concepts of object oriented programming.
Practice key features of object-oriented programming language using C++.
To capable students to Use these concepts in solving real life problems.
Reading Material
Starting Out With C++ By Tony Gaddis 7th Ed
Object Oriented Programming in C++ By Robert Lafore 4th Ed
My Lectures Slides & Our Old Friend.. Mr. oogle !
Prerequisite
Introduction to Computing & Programming (EE-121)
4
Program and Teacher
Chapter # 9
Week 3-4
Lectures 4
Introduction to Pointer Variables
Pointer Arithmetic, Initializing the Pointers
Chapter # 11
Week 5-6
Lectures 4
Introduction to Structured Data
Accessing Structure Members & Initializing a Structure
Chapter # 13 & 14 Quiz # 2
Assignment # 2
Introduction to Classes
Week 7-10
Lectures 8
Defining an Instance of a Class
Constructors & Destructors
Instance(Object) and Static Members
Chapter # 15
Inheritance Quiz # 3
Week 11-14
Lectures 8
Protected Members and Class Access Assignment # 3
Polymorphism and Virtual Member Functions
Multiple Inheritance
Week 15
Lectures 2 • Course Revision and Final Exam Overview
Marks & Grading Criteria 6
Assignments and Presentation Class Tests/ Quiz Weighted by Class Attendance and behavior
12%
8%
50%
30%
7
Quiz/Tests weighted by Attendance & Behavior
Attendance in % Weight**
100-90 100
90-85 95
85-80 90
80-75 85
Below 75* 0
* Also Marked as Short Attendance
** Weight can be enhance by class behavior
8
Assignments & Presentations
The programs are made up of functions. Functions are often not reusable. It is
very difficult to copy a function from one program and reuse in another
program because the function is likely to reference the headers, global
variables and other functions.
Procedural-Oriented languages are centered on functions which are not well-
encapsulated as a self-contained reusable unit.
The procedural languages are not suitable for solving real life problems. For
example, C programs uses if-else, for-loop, array, function, pointer, which are
low-level and hard to abstract real problems.
Programs become complex as they grows up to capture real life problems
16
Origin of OOPs
In 1970s, the US DoD commissioned a task force to investigate why its IT budget
always went out of control; but without much to show for.
The findings are:
1. 80% of the budget went to the software
1. More than 80% of the software budget went to maintenance (only the remaining 20% for new
software development).
2. Hardware components could be applied to various products
1. Hardware can share and reuse!
3. Software procedures were often non-sharable and not reusable.
The task force proposed to make software behave like hardware OBJECT.
Subsequently, DoD replaces over 450 computer languages, which were then used
to build DoD systems, with an object-oriented language called Ada.
17
Object oriented programming
language
Benefits of OOP ??
19
Foundation of object-oriented
programming:
Lecture # 3-4
RECAPITULATION OF PROCEDURE
BY ENGR. SYED ASAD ALI
ORIENTED PROGRAMMING
21
Computer Programming
If the execution of more than one statement depends on the selection, then the
statements must be blocked with curly braces as shown in the code segment in Figure
2-8
30
Logical AND and Logical OR
• Array is a variable that can store multiple values of the same type.
• The variables you have worked with so far are designed to hold only one value at a
time.
• The values are stored together in consecutive memory locations.
• Declared using [] operator:
• int tests[5];
• In this definition
• int is the data type of the array elements
• tests is the name of the array
• 5, in [5], is the size declarator.
• It shows the number of elements in the array.
Accessing Array Elements
35
• Examples Pgm
36
Functions