Java Assignment 3 OOP ATM 1
Java Assignment 3 OOP ATM 1
Note:
In Account Class:
- accountNo: is a String number which is determines account.
- ownerName: is name of customer who owner account.
- amount: is amount of account.
- AccountType: is type of account like “Saving account” or “Transaction account”.
- Deposit method accept an double value like a parametter and decrease value of amount
of current object.
- Withdraw method accept an double value like a parametter and inrement value of
amount of current object.
ATM Class:
- Using Account class and implement ATM function like withdraw, deposit, view amount,
transfer money…
- Withdraw method accepts an account object as a parameter then asks the user enter an
amount to withdraw. After that check the amount in account, if it greater than amount
withdraw then subtraction amount in account else an error message will be display in
screen.
- Deposit method accepts an account object as a parameter then asks the user enter an
amount. After that add deposit amount to account amount.
- Transfer method accepts two account objects as a parameter then asks the user enter
an amount. After that check the amount in first account, if it greater than amount
withdraw then reduce amount in first account and plus to second account else an error
message will be display in screen.
- ViewAmount method accepts an account object as a parameter then display
information of account to screen.
- Main method will call the methods to run application.