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
*/

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());

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!");

}
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;


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