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

What's hot (20)

PDF
Constructor and Destructor
Kamal Acharya
 
PPS
Wrapper class
kamal kotecha
 
PPTX
Function overloading and overriding
Rajab Ali
 
PPTX
6. static keyword
Indu Sharma Bhardwaj
 
PPTX
Chapter 8 ooad
anujabeatrice2
 
PDF
Collections In Java
Binoj T E
 
PPTX
Threads in JAVA
Haldia Institute of Technology
 
PPTX
Virtual function in C++ Pure Virtual Function
Kamlesh Makvana
 
PPT
Inter threadcommunication.38
myrajendra
 
PDF
JavaScript - Chapter 8 - Objects
WebStackAcademy
 
PPTX
Java abstract class & abstract methods
Shubham Dwivedi
 
PPSX
Collections - Lists, Sets
Hitesh-Java
 
PPT
Java
s4al_com
 
PPT
inheritance in python with full detail.ppt
ssuser7b0a4d
 
PPTX
Oops concept in c++ unit 3 -topic 4
MOHIT TOMAR
 
PPTX
Constructor and Types of Constructors
Dhrumil Panchal
 
PDF
Threads concept in java
Muthukumaran Subramanian
 
PDF
Java - File Input Output Concepts
Victer Paul
 
PPTX
This pointer
Kamal Acharya
 
PPS
Introduction to class in java
kamal kotecha
 
Constructor and Destructor
Kamal Acharya
 
Wrapper class
kamal kotecha
 
Function overloading and overriding
Rajab Ali
 
6. static keyword
Indu Sharma Bhardwaj
 
Chapter 8 ooad
anujabeatrice2
 
Collections In Java
Binoj T E
 
Virtual function in C++ Pure Virtual Function
Kamlesh Makvana
 
Inter threadcommunication.38
myrajendra
 
JavaScript - Chapter 8 - Objects
WebStackAcademy
 
Java abstract class & abstract methods
Shubham Dwivedi
 
Collections - Lists, Sets
Hitesh-Java
 
Java
s4al_com
 
inheritance in python with full detail.ppt
ssuser7b0a4d
 
Oops concept in c++ unit 3 -topic 4
MOHIT TOMAR
 
Constructor and Types of Constructors
Dhrumil Panchal
 
Threads concept in java
Muthukumaran Subramanian
 
Java - File Input Output Concepts
Victer Paul
 
This pointer
Kamal Acharya
 
Introduction to class in java
kamal kotecha
 

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
Object Oriented Programming with Real World Examples
OXUS 20
 
PDF
Everything about Object Oriented Programming
Abdul Rahman Sherzad
 
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
 
Object Oriented Programming with Real World Examples
OXUS 20
 
Everything about Object Oriented Programming
Abdul Rahman Sherzad
 
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
 
Ad

Recently uploaded (20)

PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PPTX
Essential Content-centric Plugins for your Website
Laura Byrne
 
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
[GDGoC FPTU] Spring 2025 Summary Slidess
minhtrietgect
 
PDF
“ONNX and Python to C++: State-of-the-art Graph Compilation,” a Presentation ...
Edge AI and Vision Alliance
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PDF
Linux schedulers for fun and profit with SchedKit
Alessio Biancalana
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
Evolution: How True AI is Redefining Safety in Industry 4.0
vikaassingh4433
 
PDF
Survival Models: Proper Scoring Rule and Stochastic Optimization with Competi...
Paris Women in Machine Learning and Data Science
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Essential Content-centric Plugins for your Website
Laura Byrne
 
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
[GDGoC FPTU] Spring 2025 Summary Slidess
minhtrietgect
 
“ONNX and Python to C++: State-of-the-art Graph Compilation,” a Presentation ...
Edge AI and Vision Alliance
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
Linux schedulers for fun and profit with SchedKit
Alessio Biancalana
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Evolution: How True AI is Redefining Safety in Industry 4.0
vikaassingh4433
 
Survival Models: Proper Scoring Rule and Stochastic Optimization with Competi...
Paris Women in Machine Learning and Data Science
 

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