Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Account
- {
- private int accountNumber;
- private int availableBalance;
- private int totalBalance;
- private int pin;
- public Account(int theAccountNumber, int thePIN, int theAvailableBalance, double theTotalBalance)
- {
- accountNumber = theAccountNumber;
- pin = thePIN;
- availableBalance = theAvailableBalance;
- }
- public boolean validatePIN(int userPIN)
- {
- if(userPIN == pin) return true;
- else return false;
- }
- public int getAvailableBalance()
- {
- return availableBalance;
- }
- public int getTotalBalance()
- {
- return totalBalance;
- }
- public int getAccountNumber()
- {
- return accountNumber;
- }
- public void UseBalance(int amount)
- {
- availableBalance -= amount;
- }
- }
Add Comment
Please, Sign In to add comment