You are on page 1of 28

1

OBJECT ORIENTED
PROGRAMMING
INTRODUCTION

Imran Siddiqi
Dept of CS
Bahria University, Islamabad
imran.siddiqi@bahria.edu.pk
2
COURE INFORMATION
 Course Instructor
Dr Imran Siddiqi
Office: OC Basement
Contact: imran.siddiqi@bahria.edu.pk

 Office hours

Monday to Thursday
(See Time Table)

3
AGENDA
 Course Information
 Course and Grading Policies

 Course Contents

 Programming Paradigms

 SW Development Activities

4
COURE INFORMATION
 Pre-requisite
 Fundamentals of Programming

 Course meeting times


 Lectures: 2 sessions/week (1+2)
 Lab: 1 session/week (3)

 Course Resources
 Lectures slides, assignments (computer/written),
solutions to problems, projects, and announcements
will be uploaded on course web page.
5
COURE INFORMATION
 Book

Object Oriented
Programming in C++

Robert Lafore
SAMS, 4th Edition

6
COURE INFORMATION
 Reference Book

C++ How to Program, by Dietel &


Dietel, 10th Edition, Prentice Hall
International, 2017

7
COURE INFORMATION
 Class Composition

Term Project

Readings

Lectures

8
Quizzes Assignments
COURSE INFORMATION
 Assignments

On Time
No submissions after
specified Date &
Time

No Copying
No credit for
plagiarized
content
9
GRADING POLICY*

10%

10%
Quizzes
Assignment
50% 10% Term Project
Mid Semester Exam
Final Exam

20%

Credits : 3 + 1
10

* Tentative
GRADING POLICY - LABS *

10%

30% Lab Quizzes

Lab Journal/Assessments

Midterm Assessment
40%

Final Assessment/Project
20%

11

* Tentative – Confirm from the Lab instructor


FEAR OF PROGRAMMING?

12
HOW TO SURVIVE???

 Write your programs


on your machine
 Compile
 Debug
 Execute

13
COURSE OUTLINE

 Introduction to object oriented programming


 Functions
 Function Overloading, Default Arguments
 Pointers
 Structures and Classes

 Operator Overloading

 Inheritance

 Virtual Functions and Polymorphism

 Templates

 Standard Template Library 14

 …..
MUST KNOW ABOUT
 Basic input/output
 Selection Structure
 If/Else
 Switch

 Loops
 For, While, Do-While
 Arrays

15
16
PROGRAMMING PARADIGMS
 Different programming languages follow different
approaches to solving programming problems
 A programming paradigm is an approach to
solving programming problems.
 A programming paradigm may consist of many
programming languages.
 Common programming paradigms:
 Structured Programming
 Object-Oriented Programming

17
UNSTRUCTURED PROGRAMMING
 People start learning programming by writing
small and simple programs consisting only of one
main program.
 Here “main program”' stands for a sequence of
commands or statements which modify data
which is global throughout the whole program.
 If the same statement sequence is needed at
different locations within the program, the
sequence must be copied

18
STRUCTURED PROGRAMMING
 Structured programming is based around data
structures and subroutines/Procedures.
 The subroutines are where stuff actually
"happens", and the data structures are simply
“containers” for the information needed by those
subroutines.
 Examples: C, FORTRAN, Pascal, COBOL etc

19
OBECT ORIENTED PROGRAMMING
 Object oriented programming
shifts your primary focus to the
data itself.

 Instead of designing your functions


first and then coming up with data
structures to support them, you
design types first and then come
up with the operations needed to
work with them.

20
OBECT ORIENTED PROGRAMMING
 A program in this paradigm
consists of objects having a
set of attributes and which
communicate with each other
by sending messages

 Example object oriented


languages include: Java, C#,
Smalltalk, etc

21
OBJECT ORIENTED PROGRAMMING – REAL
WORLD MAPPING

 Object: Fan
 Attributes: Price, Color, Number of blades etc.
 Actions: Turn-on, Turn-off, Clean, Mount etc.

 Object: Car
 Attributes: Price, Make, Model, Color etc.
 Actions: Drive, Park, Refuel, Wash etc.

When writing programs, attributes become data


members, actions become methods (functions)

22

00 = Object Orientation and
PIIE = Polymorphism /
Inheritance / Instantiation /
Encapsulation
OO – PIIE

OO - PIIE
Remember the following when talking about OOP

23
SOFTWARE DEVELOPMENT ACTIVITIES

Source Program

Compile
Library routines
Edit Link
Other object files
Think Load

Execute
24
A SAMPLE PROGRAM

// my first program in C++

#include <iostream>

void main (void)


{
std::cout << "Hello …";
}

25
CODE EXECUTION
 Source file “Test.cpp”

Compile
Test.cpp Test.obj

Link
Test.obj + Libraries Test.exe

26
IDES
 Integrated Development Environments or IDEs
 Supports the entire software development cycle

 E.g., MS Visual C++, Borland

 Provides all the capabilities for developing


software
 Editor
 Compiler
 Linker
 Loader
 Debugger
 Viewer 27
SUMMARY
 Course and Course Policies

 Computer Program & Computer Software

 Programming paradigms
 Structured & Object Oriented

 Software Development activities - IDEs

28

You might also like