Commit a9ea10ca authored by Daniel Pearson's avatar Daniel Pearson

Origin

parent 398b66fa
No preview for this file type
No preview for this file type
......@@ -4,7 +4,7 @@ public class BankAccount {
int accountNumber;
String name;
float balance;
static Scanner myObj = new Scanner(System.in);
static Scanner user = new Scanner(System.in);
//make it so it checks if the money is available in the account
public BankAccount(int accountNumber, String name, float balance){
......@@ -26,7 +26,7 @@ public class BankAccount {
public static void deposit(BankAccount amount){
System.out.println("\n"+"\n"+"How much would you like to deposit? ");
float depositAmount;
depositAmount = myObj.nextFloat();
depositAmount = user.nextFloat();
amount.balance += depositAmount;
System.out.println("Your total bank balance is: "+"£"+amount.balance);
......@@ -36,7 +36,7 @@ public class BankAccount {
public static void withdrawal(BankAccount amount){
System.out.println("\n"+"\n"+"How much would you like to withdraw? ");
float withdrawAmount;
withdrawAmount = myObj.nextFloat();
withdrawAmount = user.nextFloat();
if(withdrawAmount < amount.balance) {
amount.balance -= withdrawAmount;
......@@ -77,13 +77,13 @@ class savingsAccount extends BankAccount{
savingsWithdrawal(dan);
savingsBankFees(dan);
savingsDisplay(dan);
Scanner myObj1 = new Scanner(System.in);
Scanner user = new Scanner(System.in);
}
public static void savingsDeposit(BankAccount amount){
System.out.println("\n"+"\n"+"How much would you like to deposit? ");
float depositAmount;
depositAmount = myObj.nextFloat();
depositAmount = user.nextFloat();
amount.balance += depositAmount;
System.out.println("Your total bank balance is: "+"£"+amount.balance);
......@@ -93,7 +93,7 @@ class savingsAccount extends BankAccount{
public static void savingsWithdrawal(BankAccount amount){
System.out.println("\n"+"\n"+"How much would you like to withdraw? ");
float withdrawAmount;
withdrawAmount = myObj.nextFloat();
withdrawAmount = user.nextFloat();
if(withdrawAmount <= 100.0){
if(withdrawAmount < amount.balance) {
amount.balance -= withdrawAmount;
......
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