Commit 23bb95f9 authored by Henry Ewen's avatar Henry Ewen

Finished

parent c29efefd
public class BankAccount {
public int accountNumber;
public String name;
public double balance;
public double overdraft;
BankAccount(int x,String y,double z) {
accountNumber= x;
name=y;
balance=z;
overdraft=0;
}
public void desposit(int i) {
balance = i + balance;
}
public double display() {
return balance;
}
public void setbal(int i) {
balance=i;
}
public void withdrawl(int i) {
double temp =this.balance-i;
if (this.overdraft<0)
{
if (temp>this.overdraft)
{
this.balance = this.balance - i;
}
}
else
{
this.balance=this.balance-i;
}
}
public void bankFees() {
double temp= 0.05 * this.balance;
this.balance=this.balance-temp;
}
public void addOverdraft(int x) {
x=0-x;
this.overdraft=x;
}
public double thisover() {
return overdraft;
}
}
public class SavingAccount {
public int accountNumber;
public String name;
public double balance;
SavingAccount() {}
SavingAccount(int x,String y,double z) {
accountNumber= x;
name=y;
balance=z;
}
public void desposit(int i) {
balance = i + balance;
}
public double display() {
return balance;
}
public void setbal(int i) {
balance=i;
}
public void withdrawl(int i) {
if (i!=100)
{balance = balance - i;}
}
public void accrueInterest() {
double temp= 0.05 * this.balance;
this.balance=this.balance+temp;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment