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
Introduction to Koltin for Android Part I
PPTX
PPS
Wrapper class
PPTX
Abstract Data Types
PPT
Basic concept of OOP's
PPTX
PPTX
Function overloading and overriding
PPTX
Intro to JSON
Introduction to Koltin for Android Part I
Wrapper class
Abstract Data Types
Basic concept of OOP's
Function overloading and overriding
Intro to JSON

What's hot (20)

PPTX
Characteristics of OOPS
PPTX
PPTX
Inheritance in java
PPTX
Collections and its types in C# (with examples)
PPT
JDBC – Java Database Connectivity
PPTX
6-Python-Recursion PPT.pptx
PPTX
classes and objects in C++
PDF
Python : Regular expressions
PPTX
Android activity lifecycle
PPTX
INLINE FUNCTION IN C++
PPT
SQLITE Android
PDF
PPS
String and string buffer
PPT
RECURSION IN C
PDF
Java Linked List Tutorial | Edureka
PDF
C++ chapter 1
PPSX
DIWE - Advanced PHP Concepts
PPTX
Operator overloading
PPT
Swing and AWT in java
PPT
Java: Objects and Object References
Characteristics of OOPS
Inheritance in java
Collections and its types in C# (with examples)
JDBC – Java Database Connectivity
6-Python-Recursion PPT.pptx
classes and objects in C++
Python : Regular expressions
Android activity lifecycle
INLINE FUNCTION IN C++
SQLITE Android
String and string buffer
RECURSION IN C
Java Linked List Tutorial | Edureka
C++ chapter 1
DIWE - Advanced PHP Concepts
Operator overloading
Swing and AWT in java
Java: Objects and Object References
Ad

Viewers also liked (20)

PPT
Data Mining and WareHousing
PPTX
Odd Man Out and Series By Raju Makwana
PPTX
SEO Presentation
PPTX
BRAIN GATE
PPTX
Characteristics of oop
PPTX
Nano med bot technology by manish myst ssgbcoet
PPT
Space Mouse_Krishna Raj
PPTX
Project presentation image compression by manish myst, ssgbcoet
PPT
15067420 space-mouse-rahul-raj
PPTX
Space mouse sameer kumar telikicherla
PPT
Space mouse And Space Mouse Pro
KEY
Practical OOP In Java
PPSX
Slide for space mouse by manish myst, ssgbcoet
PPTX
Final ppt
DOCX
pill camera
PPT
SKYBUS TECHNOLOGY
PPT
Space Mouse
PPT
Sky bus
PPTX
My seminar ppt SPACE MOUSE
PPTX
Pill camera ppt
Data Mining and WareHousing
Odd Man Out and Series By Raju Makwana
SEO Presentation
BRAIN GATE
Characteristics of oop
Nano med bot technology by manish myst ssgbcoet
Space Mouse_Krishna Raj
Project presentation image compression by manish myst, ssgbcoet
15067420 space-mouse-rahul-raj
Space mouse sameer kumar telikicherla
Space mouse And Space Mouse Pro
Practical OOP In Java
Slide for space mouse by manish myst, ssgbcoet
Final ppt
pill camera
SKYBUS TECHNOLOGY
Space Mouse
Sky bus
My seminar ppt SPACE MOUSE
Pill camera ppt
Ad

Similar to Object Oriented Programming (20)

PPT
ObjectOrientedSystems.ppt
PPTX
3_ObjectOrientedSystems.pptx
PPT
CHAPTER 1 - OVERVIEW OOP.ppt
PPT
Chapter1 - Introduction to Object-Oriented Programming and Software Development
PPT
Java căn bản- Chapter1
PDF
Object Oriented Programming with Real World Examples
PDF
Everything about Object Oriented Programming
PPT
Object Oriented Concept
 
PPT
2. oop with c++ get 410 day 2
PDF
Object-Oriented Programming in Java (Module 1)
DOCX
CSc investigatory project
PDF
Rajeev oops 2nd march
PPTX
Analyzing a system and specifying the requirements
PPTX
Object Oriented Programming C#
PDF
Introduction to oops concepts
PDF
OOPs theory about its concepts and properties.
PPT
What is OOP?
ObjectOrientedSystems.ppt
3_ObjectOrientedSystems.pptx
CHAPTER 1 - OVERVIEW OOP.ppt
Chapter1 - Introduction to Object-Oriented Programming and Software Development
Java căn bản- Chapter1
Object Oriented Programming with Real World Examples
Everything about Object Oriented Programming
Object Oriented Concept
 
2. oop with c++ get 410 day 2
Object-Oriented Programming in Java (Module 1)
CSc investigatory project
Rajeev oops 2nd march
Analyzing a system and specifying the requirements
Object Oriented Programming C#
Introduction to oops concepts
OOPs theory about its concepts and properties.
What is OOP?

Recently uploaded (20)

PPT
Teaching material agriculture food technology
PPTX
Cloud computing and distributed systems.
PDF
Approach and Philosophy of On baking technology
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
KodekX | Application Modernization Development
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Teaching material agriculture food technology
Cloud computing and distributed systems.
Approach and Philosophy of On baking technology
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Spectral efficient network and resource selection model in 5G networks
Understanding_Digital_Forensics_Presentation.pptx
KodekX | Application Modernization Development
Network Security Unit 5.pdf for BCA BBA.
Advanced methodologies resolving dimensionality complications for autism neur...
“AI and Expert System Decision Support & Business Intelligence Systems”
NewMind AI Monthly Chronicles - July 2025
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
MYSQL Presentation for SQL database connectivity
20250228 LYD VKU AI Blended-Learning.pptx
Review of recent advances in non-invasive hemoglobin estimation
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Encapsulation_ Review paper, used for researhc scholars
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
CIFDAQ's Market Insight: SEC Turns Pro Crypto

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