0% found this document useful (0 votes)
98 views20 pages

Object-Oriented Programming (OOP) Lecture No. 1: Division of Science and Technology University of Education, Lahore

The document outlines an object-oriented programming course, including its objectives, contents, books, grading policy, and prerequisites. The course aims to introduce students to OOP concepts like classes, inheritance, polymorphism, and interfaces using C++. Topics include class fundamentals, inheritance, polymorphism, interfaces, exception handling, and file handling. The grading will be based on practicals, sessionals, midterm, and final exam. Basic programming knowledge is required. Examples of objects like cars and dates are provided to illustrate OOP concepts.

Uploaded by

Sabina Fiza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views20 pages

Object-Oriented Programming (OOP) Lecture No. 1: Division of Science and Technology University of Education, Lahore

The document outlines an object-oriented programming course, including its objectives, contents, books, grading policy, and prerequisites. The course aims to introduce students to OOP concepts like classes, inheritance, polymorphism, and interfaces using C++. Topics include class fundamentals, inheritance, polymorphism, interfaces, exception handling, and file handling. The grading will be based on practicals, sessionals, midterm, and final exam. Basic programming knowledge is required. Examples of objects like cars and dates are provided to illustrate OOP concepts.

Uploaded by

Sabina Fiza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Object-Oriented Programming

(OOP)
Lecture No. 1

Division of science and Technology


University of Education, Lahore
Course Objectives
• Objective of this course is to make students familiar with the concepts
of object-oriented programming

• Concepts will be reinforced by their implementation in C++


Course Contents
• Basic of Object Oriented Programming: Evolution of object oriented Paradigm,
Object oriented concepts and principles, problem solving in object oriented
paradigm, Object oriented program design process.
• Class Fundamentals; Classes, methods, objects and encapsulation; constructors
and destructors, operator and function overloading, virtual functions.
• Inheritance: Derived classes, Member access, Super, Types of inheritance.
• Polymorphism: Method overriding, Dynamic method dispatch, Abstract classes
and variables, Final keywords.
• Interfaces: Define interface, Implements and apply interfaces, Variable in
interfaces and extent interface.
• Exception Handling: Exception fundamental, Exception types, Built-in and User
defined exception.
• File Handling: I/O and file processing, Practical, Assignments and mini project.
Books
• C++ How to Program
By Deitel & Deitel

• The C++ Programming Language


By Bjarne Stroustrup

• Object-Oriented Software Engineering


By Jacobson, Christerson, Jonsson, Overgaard
Grading Policy
• Practical 15 %
• Sessional 20 %
• Mid-Term 20 %
• Final 45 %
Pre-requisite knowledge
(Programming fundamentals concepts )
• Introduction to Programming: Problem solving, Introduction to programming and programs,
Types of languages, Compiler vs. Interpreter.
• Overview of Programming: Structure of Program, indentation and coding conventions, Program
output, Syntax rules, Common errors, Language keywords.
• Data Types: Identifiers, Constants, Types of variables, Type conversion and casting, Type
promotion rules.
• Operators: Arithmetic operators and punctuations, Precedence, Associations, Equality and
relational operators.
• Control Statements: Selection structure (if/, if/else), Multiple selection structure (switch and
break), break and continue, Loops.
• Arrays: Declaring arrays; Initialization, Multidimensional arrays, Two dimensional array, Example
(Matrix manipulation), Assignments, Mini Project.
• Methods/Functions: Library functions, Modular Approach, Functions, Function definitions.
Function prototypes.
• Class Fundamentals: Class syntax, General form of class, Object declaration.
Pre-requisite recall ( Practice problem)

• C++ program to add two integers using functions

Topics covered: data type, scope, variables, selection, loop, function,


basic I/O.
#include <iostream> #include <iostream>
using namespace std; using namespace std;
int sum(int x ,int y); int main()
int main() {
{ int x, y; int arr[] = {11, 22, 33, 44, 55};
cout<<"enter first number: "; int n=0;
cin>> x; while(n<=4)
cout<<"enter second number: "; {
cin>>y; cout<<arr[n]<<endl; n++;
cout<<"Sum of these two :"<<sum(x,y); }
return 0; return 0;
} }
int sum(int a, int b)
{
int c = a+b;
return c;
}
Object-Orientation (OO)
• A technique for system modeling ( system is set of interacting
components)

• OO model consists of several interacting objects


Examples -Models
• Highway maps

• Architectural models

• Mechanical models
Objects - Examples
Why object orientation?
• Procedural Vs OO techniques

• Close to real world ( objects and interactions)

• Modularity ( Examples – student management system)

• Maintenance ( Requirement changes- extensions required)


What is an object?
An object is

• Something tangible (Ali, Car)

• Something that can be apprehended intellectually (Time, Date)


…what is an object?
An object has

• 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)

• Analysis: C++ program for identifying prime numbers (project 137927)

• 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

You might also like