L1 Intro To OOP
L1 Intro To OOP
Lecture 1
Course Outcome
The following are expected outcomes from the students after the completion of this course,
2
Assessment method
External Assessment –
◦ T1 – 20 Marks
◦ T2 – 20 Marks
◦ End Semester Exam – 35 Marks
3
C Vs C++
C is a structural or procedural programming language that was used
for system applications and low-level programming applications.
C++ is an object-oriented programming language having some
additional features like Encapsulation, Data Hiding, Data Abstraction,
Inheritance, Polymorphism, etc. This helps to make a complex project
more secure and flexible
▪ Only those functions which are encapsulated together can access the data.
▪ These bounded functions acts like an interface that allows access to the data
for any program.
▪ By restricting the access to data, it provides data hiding from external
program.
Class A
Data
Functions
Introduction to object oriented
programming
▪ Data Abstraction shows only relevant information about the objects instead of
the entire background details.
▪ It separates the interface from its implementation.
▪ Classes are used to implement abstraction and they are called as abstract data
types (ADT).
▪ For example, the function cout is used as a interface to display on the console
and the internal implementation is not revealed to the outside world.
Introduction to object oriented
programming
▪ Inheritance is a way to include functionalities of a parent class to a child class.
▪ It doesn’t allow inheritance of private members from parent class.
▪ It enhances code reusability. Class A
Data
Functions
Class B
Data
Functions
Sub Class: The class that inherits properties from another class is called Sub
class or Derived Class.
Super Class: The class whose properties are inherited by sub class is called
Base Class or Super class.
Introduction to object oriented
programming
▪ Polymorphism enables to define many forms of a function and it is
invoked based on the object calling it.
▪ The functionality of a function differs according to the object that
calls it.
Class A
▪ Inheritance helps to implement polymorphism.
Data
Functions
Class B
Data
Functions
Benefits of object oriented
programming
▪ Data hiding helps to protect the data and it secures the programs.
▪ Exception handling can be performed using OOP.
▪ Program templates can be developed and used in future applications.
▪ Programs can be easily upgraded and portable.
▪ Reduces redundant codes and improves code reusability.
▪ Improves productivity by saving development time.
References
▪Herbert Schildt, “C++: The complete reference”, Mc Graw Hill Osborne media, 4th edition, 2017
▪Robert Lafore, “Object oriented programming in C++”, SAMS, 4th edition, 2002
15