Commit 173e2c62 authored by tahsif.ahmed's avatar tahsif.ahmed

Upload New File

parent 8f9533ca
public class Main {
public static void main(String[] args){
bankaccount bank = new bankaccount(92910,"Tahsif",200.00,false);
bank.balance = widthdrawal(bank.balance, 150, bank.isSaving);
bank.balance = bankFees(bank.balance, bank.isSaving);
bank.balance = accureInterest(bank.balance, bank.isSaving);
/*display(bank.accountNumber, bank.name, bank.balance);*/
}
public double deposit(double a, double b){
a = a + b;
System.out.println("You have deopsited: "+b+" You now have: "+a);
return a;
}
public static double widthdrawal(double a, double b, boolean isSaving){
if(isSaving == true && b > 100){
System.out.println("You cannot widthdraw more than £100");
}
else{
a = a-b;
System.out.println("You have widthdrew: "+b+" You now have: "+a);
return a;
}
return a;
}
public static double bankFees(double a, boolean isSaving){
if(isSaving == true){
System.out.println("You do not accrue bank fees with a saving account");
}
else{
a = a*0.95;
System.out.println("You have to pay a bank fee of 5%. You have: "+a);
}
return a;
}
public static double accureInterest(double balance, boolean isSaving){
if(isSaving == true){
balance = balance * 1.05;
System.out.println("You have accurued interest of 5%, You now have: "+balance);
return balance;
}
return balance;
}
public static void display(int acnum, String name, double balance){
System.out.println("Account number: " + acnum);
System.out.println("Name: "+name);
System.out.println("Balance: "+balance);
}
}
\ No newline at end of file
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