outprintlnAfter Withdraw Account Balance is

Outprintlnafter withdraw account balance is

  • Ryerson University
  • COE 618
  • Lab Report
  • Pakistani
  • 14
  • 100% (3) 3 out of 3 people found this document helpful

This preview shows page 10 - 14 out of 14 pages.

System.out.println("After Withdraw Account Balance is:"); System.out.println(CheqOnlyCustomer.this.getCheckBalance()); } public boolean positiveCheck(int money) { if (money > 0) { return true; } return false; } } package coe618.lab5; /** * * @author Hammad */
Image of page 10
public class CheqSavCustomer extends Account { protected int savBal; protected int checkBal; public CheqSavCustomer(String Name, String Password, int AccountType, int CheqBal, int SavBal) { super(Name, Password, AccountType); try { if (CheqBal>=20 && SavBal >=20) { this.checkBal = CheqBal; this.savBal = SavBal; this.accountType = 2; } else this.checkBal = 1 / 0; } catch (ArithmeticException e) { System.err.println("Chequing & Saving Account Must be greater than $20!!!"); } } public int getSavBal() { return CheqSavCustomer.this.savBal; } public int getCheckBalance() { return CheqSavCustomer.this.checkBal; } public void savDeposit(int Amt) { System.out.println("Current Saving Account Balance is:"); System.out.println(CheqSavCustomer.this.getSavBal()); CheqSavCustomer.this.savBal += Amt; System.out.println("After Deposit Account Balance is:"); System.out.println(CheqSavCustomer.this.getSavBal()); } public void cheqDeposit(int Amt) { System.out.println("Current Chequing Account Balance is:"); System.out.println(CheqSavCustomer.this.getCheckBalance()); CheqSavCustomer.this.checkBal += Amt; System.out.println("After Deposit Account Balance is:"); System.out.println(CheqSavCustomer.this.getCheckBalance()); } public void savWithDraw(int Amt) { System.out.println("Current Saving Account Balance is:"); System.out.println(CheqSavCustomer.this.getSavBal());
Image of page 11
int tmp = CheqSavCustomer.this.savBal - Amt; if (positiveCheck(tmp)) { CheqSavCustomer.this.savBal = tmp; } else { System.err.println("Insufficient funds in Savings Account!"); } System.out.println("After Withdraw Account Balance is:"); System.out.println(CheqSavCustomer.this.getSavBal()); } public void cheqWithDraw(int Amt) { System.out.println("Current Chequing Account Balance is:"); System.out.println(CheqSavCustomer.this.getCheckBalance()); int tmp = CheqSavCustomer.this.checkBal - Amt; if (positiveCheck(tmp)) { CheqSavCustomer.this.checkBal = tmp; } else { System.err.println("Insufficient funds in chequing Account!"); } System.out.println("After Withdraw Account Balance is:"); System.out.println(CheqSavCustomer.this.getCheckBalance()); } public void Cheq2Sav(int Amt) { System.out.println("Current Chequing Account Balance is:"); System.out.println(CheqSavCustomer.this.getCheckBalance()); System.out.println("Current & Saving Account Balance is:"); System.out.println(CheqSavCustomer.this.getSavBal()); int tmp = CheqSavCustomer.this.checkBal - Amt; if (positiveCheck(tmp)) { CheqSavCustomer.this.checkBal = tmp; CheqSavCustomer.this.savBal += Amt; } else { System.err.println("Insufficient funds in chequing Account!");
Image of page 12
} System.out.println("After Withdraw Cheqing is:"); System.out.println(CheqSavCustomer.this.getCheckBalance()); System.out.println("After Withdraw Saving is:"); System.out.println(CheqSavCustomer.this.getSavBal()); } public void Sav2Chqu(int Amt) { System.out.println("Current Chequing Account Balance is:"); System.out.println(CheqSavCustomer.this.getCheckBalance()); System.out.println("Current Saving Account Balance is:"); System.out.println(CheqSavCustomer.this.getSavBal()); int tmp = CheqSavCustomer.this.checkBal - Amt;
Image of page 13
Image of page 14

You've reached the end of your free preview.

Want to read all 14 pages?

  • Fall '15
  • OLIVIADAS
  • Cheque, Deposit account, Savings account, Void type, Money market deposit account, Chequing

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture