SlideShare a Scribd company logo
Object Oriented Programming
Problem Description
“ …customers are allowed to have
different types of bank accounts,
deposit money, withdraw money and
transfer money between accounts”
Procedural Approach
bool MakeDeposit(int accountNum,float amount);
float Withdraw(int accountNum,float amount);
struct Account {
char *name;
int accountNum;
float balance;
char accountType;
};
Procedural Approach cont’d
Focus is on procedures
All data is shared: no protection
More difficult to modify
Hard to manage complexity
Procedural vs. Object-Oriented
Procedural
Withdraw, deposit, transfer
Object Oriented
Customer, money, account
Mapping the world to software
Objects in the problem domain are mapped
to objects in software
Object Oriented
Data and operations are grouped together
Account
Withdraw
Deposit
Transfer
Interface:
Set of available operations
Data Encapsulation
class Account {
public:
float withdraw();
void deposit(float amount);
private:
float balance;
);
Advantages of Encapsulation
Protection
Consistency
Allows change
Objects and Classes
Classes reflect concepts, objects reflect
instances that embody those concepts.
Daria Jane BrittanyJodie
girlclassobject
Objects and Classes cont’d
A class captures the common
properties of the objects instantiated
from it
A class characterizes the common
behavior of all the objects that are its
instances
Objects and Classes cont’d
Class BankAccount
Balance
InterestYTD
Owner
Account_number
Balance 500
InterestYTD
Owner
Account_number
Balance 10,000
InterestYTD
Owner
Account_number
Operations
MakeDesposit
Transfer
WithDraw
GetBalance
Objects as instances of Classes
The world conceptually consists of objects
Many objects can be said to be of the same
type or class
 My bank account, your bank account, Bill Gates’
bank account …
We call the object type a class
Instantiation
An Object is instantiated from a Class
BankAccount myAccount;
myAccount = new BankAccount;
Objects and Classes
Class
 Visible in source
code
 The code is not
duplicated
Object
 Own copy of data
 Active in running
program
 Occupies memory
 Has the set of
operations given in
the class
Classification
Mammal
Rodent Primate Cats
Reptile
Animal
Squirel RabbitMouse
Classification
Enjoy a variety of personal banking options from First American. The following
outlines a number of First American products. If you have any questions, please
visit any First American Branch or contact us.
Checking
•Bank a lot without spending a lot: ValueFirst® Checking.
•Few checks and prefer PC Banking or ATMs: Select Access.
•Earn interest on checking dollars: First Interest Checking
•You are 55 years or better: 55 & Better Silver
•Premium checking features with higher interest rates than a personal checking account: First
American Platinum Checking
•Write less than 10 checks per month, or bank through an ATM: Budget Checking.
•Younger than 24 years old and in school: Student Checking
•Less than 20 transactions per month (excluding ATM, POS, and CheckCard): First Account
•Make the most out of every dollar: Tailored Money Sweep
Classification
Checking Account
Value First Select Access First Interest
Savings Account
Account
Inheritance
A class which is a subtype of a more
general class is said to be inherited
from it.
The sub-class inherits the base class’
data members and member functions
Inheritance cont’d
A sub-class has all data members of its
base-class plus its own
A sub-class has all member functions of
its base class (with changes) plus its
own
Inheritance is meant to implement sub-
typing (don’t abuse it)
Abstraction
Management of complexity
Hierarchical classification:
is-a relationship: inheritance
has-a relationship: containment
Polymorphism
One interface
Multiple implementations
Inheritance
Method overloading
What is a good class ?
A class abstracts objects
A class should be non-trivial in the
context of the program (has data
structures and operations different from
other classes)
Summary
What is Object Oriented Programming?
Object-oriented programming is a method of
implementation in which programs are
organized as cooperative collections of
objects, each of which represents an instance
of some class, and whose classes are all
members of one or more hierarchy of classes
united via inheritance relationships

More Related Content

PPTX
Procedural vs. object oriented programming
Haris Bin Zahid
 
PPTX
[OOP - Lec 19] Static Member Functions
Muhammad Hammad Waseem
 
PPT
Introduction To C#
SAMIR BHOGAYTA
 
PPTX
classes and objects in C++
HalaiHansaika
 
PPT
Operator Overloading
Nilesh Dalvi
 
PPTX
Functions in c language
tanmaymodi4
 
PPTX
Abstract Data Types
karthikeyanC40
 
PPSX
Type conversion
Frijo Francis
 
Procedural vs. object oriented programming
Haris Bin Zahid
 
[OOP - Lec 19] Static Member Functions
Muhammad Hammad Waseem
 
Introduction To C#
SAMIR BHOGAYTA
 
classes and objects in C++
HalaiHansaika
 
Operator Overloading
Nilesh Dalvi
 
Functions in c language
tanmaymodi4
 
Abstract Data Types
karthikeyanC40
 
Type conversion
Frijo Francis
 

What's hot (20)

PPT
Boolean Algebra
blaircomp2003
 
PPTX
Abstract class and Interface
Haris Bin Zahid
 
PPTX
oops concept in java | object oriented programming in java
CPD INDIA
 
PPTX
Storage classes in C
Self employed
 
PPTX
Concept of OOPS with real life examples
Neha Sharma
 
PPTX
Constructor and Types of Constructors
Dhrumil Panchal
 
PPTX
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
Simplilearn
 
PPTX
Polymorphism In c++
Vishesh Jha
 
PPTX
Object Oriented Programming
Iqra khalil
 
PPT
Operators in C++
Sachin Sharma
 
PPTX
functions of C++
tarandeep_kaur
 
PPTX
Inheritance in java
Tech_MX
 
PPT
Final keyword in java
Lovely Professional University
 
PPTX
Introduction to php
Taha Malampatti
 
PPTX
Static Data Members and Member Functions
MOHIT AGARWAL
 
PPTX
inline function
imran khan
 
PPTX
Switch case in C++
Barani Govindarajan
 
PPTX
Templates in C++
Tech_MX
 
Boolean Algebra
blaircomp2003
 
Abstract class and Interface
Haris Bin Zahid
 
oops concept in java | object oriented programming in java
CPD INDIA
 
Storage classes in C
Self employed
 
Concept of OOPS with real life examples
Neha Sharma
 
Constructor and Types of Constructors
Dhrumil Panchal
 
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
Simplilearn
 
Polymorphism In c++
Vishesh Jha
 
Object Oriented Programming
Iqra khalil
 
Operators in C++
Sachin Sharma
 
functions of C++
tarandeep_kaur
 
Inheritance in java
Tech_MX
 
Final keyword in java
Lovely Professional University
 
Introduction to php
Taha Malampatti
 
Static Data Members and Member Functions
MOHIT AGARWAL
 
inline function
imran khan
 
Switch case in C++
Barani Govindarajan
 
Templates in C++
Tech_MX
 
Ad

Viewers also liked (20)

PPT
Data Mining and WareHousing
Vishakha Agarwal
 
PPTX
Odd Man Out and Series By Raju Makwana
RAJU MAKWANA
 
PPTX
SEO Presentation
RAJU MAKWANA
 
PPTX
BRAIN GATE
Vishakha Agarwal
 
PPTX
Characteristics of oop
Rasim Izhar Ali
 
PPTX
Nano med bot technology by manish myst ssgbcoet
Manish Myst
 
PPT
Space Mouse_Krishna Raj
Krishna Raj .S
 
PPTX
Project presentation image compression by manish myst, ssgbcoet
Manish Myst
 
PPT
15067420 space-mouse-rahul-raj
Srishti Sabharwal
 
PPTX
Space mouse sameer kumar telikicherla
Sameer Telikicherla
 
PPT
Space mouse And Space Mouse Pro
Vishakha Agarwal
 
KEY
Practical OOP In Java
wiradikusuma
 
PPSX
Slide for space mouse by manish myst, ssgbcoet
Manish Myst
 
PPTX
Final ppt
pramada
 
DOCX
pill camera
nidhin999
 
PPT
SKYBUS TECHNOLOGY
INDUSTRIAL ENGINEERING
 
PPT
Space Mouse
RAJU MAKWANA
 
PPT
Sky bus
JNTU
 
PPTX
My seminar ppt SPACE MOUSE
Sudeep Kumar
 
PPTX
Pill camera ppt
sudheer sandy
 
Data Mining and WareHousing
Vishakha Agarwal
 
Odd Man Out and Series By Raju Makwana
RAJU MAKWANA
 
SEO Presentation
RAJU MAKWANA
 
BRAIN GATE
Vishakha Agarwal
 
Characteristics of oop
Rasim Izhar Ali
 
Nano med bot technology by manish myst ssgbcoet
Manish Myst
 
Space Mouse_Krishna Raj
Krishna Raj .S
 
Project presentation image compression by manish myst, ssgbcoet
Manish Myst
 
15067420 space-mouse-rahul-raj
Srishti Sabharwal
 
Space mouse sameer kumar telikicherla
Sameer Telikicherla
 
Space mouse And Space Mouse Pro
Vishakha Agarwal
 
Practical OOP In Java
wiradikusuma
 
Slide for space mouse by manish myst, ssgbcoet
Manish Myst
 
Final ppt
pramada
 
pill camera
nidhin999
 
SKYBUS TECHNOLOGY
INDUSTRIAL ENGINEERING
 
Space Mouse
RAJU MAKWANA
 
Sky bus
JNTU
 
My seminar ppt SPACE MOUSE
Sudeep Kumar
 
Pill camera ppt
sudheer sandy
 
Ad

Similar to Object Oriented Programming (20)

PPT
ObjectOrientedSystems.ppt
ChishaleFriday
 
PPTX
3_ObjectOrientedSystems.pptx
RokaKaram
 
PPT
CHAPTER 1 - OVERVIEW OOP.ppt
NgoHuuNhan1
 
PPT
Java căn bản- Chapter1
Vince Vo
 
PPT
Chapter1 - Introduction to Object-Oriented Programming and Software Development
Eduardo Bergavera
 
PDF
Everything about Object Oriented Programming
Abdul Rahman Sherzad
 
PDF
Object Oriented Programming with Real World Examples
OXUS 20
 
PPT
Object Oriented Concept
smj
 
PPT
2. oop with c++ get 410 day 2
Mukul kumar Neal
 
PDF
Object-Oriented Programming in Java (Module 1)
muhammadmubinmacadad2
 
DOCX
CSc investigatory project
DIVYANSHU KUMAR
 
PDF
Rajeev oops 2nd march
Rajeev Sharan
 
PPTX
Analyzing a system and specifying the requirements
vikramgopale2
 
PPTX
Object Oriented Programming C#
Muhammad Younis
 
PDF
Introduction to oops concepts
Nilesh Dalvi
 
PDF
OOPs theory about its concepts and properties.
ssuser1af273
 
PPT
What is OOP?
Amin Uddin
 
ObjectOrientedSystems.ppt
ChishaleFriday
 
3_ObjectOrientedSystems.pptx
RokaKaram
 
CHAPTER 1 - OVERVIEW OOP.ppt
NgoHuuNhan1
 
Java căn bản- Chapter1
Vince Vo
 
Chapter1 - Introduction to Object-Oriented Programming and Software Development
Eduardo Bergavera
 
Everything about Object Oriented Programming
Abdul Rahman Sherzad
 
Object Oriented Programming with Real World Examples
OXUS 20
 
Object Oriented Concept
smj
 
2. oop with c++ get 410 day 2
Mukul kumar Neal
 
Object-Oriented Programming in Java (Module 1)
muhammadmubinmacadad2
 
CSc investigatory project
DIVYANSHU KUMAR
 
Rajeev oops 2nd march
Rajeev Sharan
 
Analyzing a system and specifying the requirements
vikramgopale2
 
Object Oriented Programming C#
Muhammad Younis
 
Introduction to oops concepts
Nilesh Dalvi
 
OOPs theory about its concepts and properties.
ssuser1af273
 
What is OOP?
Amin Uddin
 

Recently uploaded (20)

PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
PPTX
Coupa-Overview _Assumptions presentation
annapureddyn
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Revolutionize Operations with Intelligent IoT Monitoring and Control
Rejig Digital
 
PDF
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
SMACT Works
 
PDF
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
DevOps & Developer Experience Summer BBQ
AUGNYC
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Doc9.....................................
SofiaCollazos
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Best ERP System for Manufacturing in India | Elite Mindz
Elite Mindz
 
PDF
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
Coupa-Overview _Assumptions presentation
annapureddyn
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Revolutionize Operations with Intelligent IoT Monitoring and Control
Rejig Digital
 
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
SMACT Works
 
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
DevOps & Developer Experience Summer BBQ
AUGNYC
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Doc9.....................................
SofiaCollazos
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Best ERP System for Manufacturing in India | Elite Mindz
Elite Mindz
 
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 

Object Oriented Programming

  • 2. Problem Description “ …customers are allowed to have different types of bank accounts, deposit money, withdraw money and transfer money between accounts”
  • 3. Procedural Approach bool MakeDeposit(int accountNum,float amount); float Withdraw(int accountNum,float amount); struct Account { char *name; int accountNum; float balance; char accountType; };
  • 4. Procedural Approach cont’d Focus is on procedures All data is shared: no protection More difficult to modify Hard to manage complexity
  • 5. Procedural vs. Object-Oriented Procedural Withdraw, deposit, transfer Object Oriented Customer, money, account
  • 6. Mapping the world to software Objects in the problem domain are mapped to objects in software
  • 7. Object Oriented Data and operations are grouped together Account Withdraw Deposit Transfer Interface: Set of available operations
  • 8. Data Encapsulation class Account { public: float withdraw(); void deposit(float amount); private: float balance; );
  • 10. Objects and Classes Classes reflect concepts, objects reflect instances that embody those concepts. Daria Jane BrittanyJodie girlclassobject
  • 11. Objects and Classes cont’d A class captures the common properties of the objects instantiated from it A class characterizes the common behavior of all the objects that are its instances
  • 12. Objects and Classes cont’d Class BankAccount Balance InterestYTD Owner Account_number Balance 500 InterestYTD Owner Account_number Balance 10,000 InterestYTD Owner Account_number Operations MakeDesposit Transfer WithDraw GetBalance
  • 13. Objects as instances of Classes The world conceptually consists of objects Many objects can be said to be of the same type or class  My bank account, your bank account, Bill Gates’ bank account … We call the object type a class
  • 14. Instantiation An Object is instantiated from a Class BankAccount myAccount; myAccount = new BankAccount;
  • 15. Objects and Classes Class  Visible in source code  The code is not duplicated Object  Own copy of data  Active in running program  Occupies memory  Has the set of operations given in the class
  • 17. Classification Enjoy a variety of personal banking options from First American. The following outlines a number of First American products. If you have any questions, please visit any First American Branch or contact us. Checking •Bank a lot without spending a lot: ValueFirst® Checking. •Few checks and prefer PC Banking or ATMs: Select Access. •Earn interest on checking dollars: First Interest Checking •You are 55 years or better: 55 & Better Silver •Premium checking features with higher interest rates than a personal checking account: First American Platinum Checking •Write less than 10 checks per month, or bank through an ATM: Budget Checking. •Younger than 24 years old and in school: Student Checking •Less than 20 transactions per month (excluding ATM, POS, and CheckCard): First Account •Make the most out of every dollar: Tailored Money Sweep
  • 18. Classification Checking Account Value First Select Access First Interest Savings Account Account
  • 19. Inheritance A class which is a subtype of a more general class is said to be inherited from it. The sub-class inherits the base class’ data members and member functions
  • 20. Inheritance cont’d A sub-class has all data members of its base-class plus its own A sub-class has all member functions of its base class (with changes) plus its own Inheritance is meant to implement sub- typing (don’t abuse it)
  • 21. Abstraction Management of complexity Hierarchical classification: is-a relationship: inheritance has-a relationship: containment
  • 23. What is a good class ? A class abstracts objects A class should be non-trivial in the context of the program (has data structures and operations different from other classes)
  • 24. Summary What is Object Oriented Programming? Object-oriented programming is a method of implementation in which programs are organized as cooperative collections of objects, each of which represents an instance of some class, and whose classes are all members of one or more hierarchy of classes united via inheritance relationships