Object Oriented Programming
Object Oriented Programming
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 Object Oriented
0110100
011101
010101
10011
1110101 11101
11010
10101
Object Oriented
Data and operations are grouped
together
Account Interface:
Balance MakeDesposit
InterestYTD Transfer
Owner WithDraw
Account_number GetBalance
Animal
Mammal Reptile
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
Account