@@ -11,18 +11,13 @@ public class Bank {
11
11
static Scanner inputAccountLimit = new Scanner (System .in );
12
12
static Scanner inputAccountWithdraw = new Scanner (System .in );
13
13
static int accountCount = 0 ;
14
- boolean haveManager = false ;
15
14
public static void main (String [] args ) {
16
15
Account [] account ;
17
16
account = new Account [9999 ];
18
- Person [] person ;
19
- person = new Person [9999 ];
20
-
21
17
welcomeMenu (account );
22
18
}
23
19
24
20
public static void welcomeMenu (Account [] account ) {
25
-
26
21
boolean end = false ;
27
22
System .out .println ("@@@@ Welcome to the RMUTT BANK @@@@" );
28
23
while (end == false ) {
@@ -50,7 +45,7 @@ public static void welcomeMenu(Account[] account) {
50
45
}
51
46
}
52
47
53
- public static void Login (Account [] account , int accountCount ) {
48
+ public static void LoginMenu (Account [] account , int accountCount ) {
54
49
boolean end = false ;
55
50
System .out .println ("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" );
56
51
System .out .println ("@@@@ Welcome to the RMUTT BANK @@@@" );
@@ -158,7 +153,7 @@ public static void LoginSystem(Account[] account, int accountCount) {
158
153
System .out .println ("\n Change account." );
159
154
holderAccount = true ;
160
155
holderMenu = false ;
161
- Login (account , accountCount );
156
+ LoginMenu (account , accountCount );
162
157
break ;
163
158
case 6 :
164
159
if (((Account ) account [k ]).getaccountInfo () == true ) {
@@ -254,7 +249,7 @@ public static void manageAccount(Account[] account) {
254
249
System .out .println ("\n Error " + e + " Please try again" );
255
250
}
256
251
257
- Login (account , accountLimit );
252
+ LoginMenu (account , accountLimit );
258
253
259
254
}
260
255
@@ -314,7 +309,7 @@ public static void createAccount(Account[] account, int accountCount) {
314
309
System .out .println ("Account Balance = " + ((Account ) account [j ]).getAccountBalance ());
315
310
}
316
311
if (accountCount == accountLimit ) {
317
- Login (account , accountCount );
312
+ LoginMenu (account , accountCount );
318
313
}
319
314
} catch (InputMismatchException e ) {
320
315
System .out .println ("\n Error " + e + " Please try again" );
@@ -386,7 +381,7 @@ public static void setManager(Account[] account, int accountCount) {
386
381
}
387
382
388
383
}
389
- Login (account , accountCount );
384
+ LoginMenu (account , accountCount );
390
385
}
391
386
392
387
public static void getManagerInfo (Account [] account , int accountCount ) {
@@ -417,13 +412,13 @@ public static void getManagerInfo(Account[] account, int accountCount) {
417
412
}
418
413
419
414
}
420
- Login (account , accountCount );
415
+ LoginMenu (account , accountCount );
421
416
}
422
417
423
418
public static void Transferable (Account [] account , int accountId ) {
424
419
Scanner inputAccountTransfer = new Scanner (System .in );
425
420
Scanner inputAccountAmount = new Scanner (System .in );
426
- System .out .print ("\n Enter other account to transfer: " );
421
+ System .out .print ("\n Enter other account id to transfer: " );
427
422
String transferTo = inputAccountTransfer .nextLine ();
428
423
System .out .print ("\n Enter transfer amount: " );
429
424
int amount = inputAccountAmount .nextInt ();
@@ -459,34 +454,6 @@ public static void Transferable(Account[] account, int accountId) {
459
454
}
460
455
}
461
456
462
- // public static void Transferable(Account[] account, int accountId) {
463
- // Scanner inputAccountTransfer = new Scanner(System.in);
464
- // System.out.println(" Enter transfer amount: ");
465
- // int transfer = inputAccountTransfer.nextInt();
466
- // if (transfer > ((Account) account[accountId]).getAccountBalance()) {
467
- // System.out.println("********** Transfer Fail!");
468
- // System.out.println("********** Your Balance is " + ((Account) account[accountId]).getAccountBalance());
469
- // try {
470
- // TimeUnit.SECONDS.sleep(2);
471
- // } catch (InterruptedException e) {
472
-
473
- // e.printStackTrace();
474
- // }
475
- // } else {
476
- // int balance = ((Account) account[accountId]).getAccountBalance();
477
- // balance -= transfer;
478
- // ((Account) account[accountId]).setAccountBalance(balance);
479
- // System.out.println("********** Transfer Success!");
480
- // System.out.println("********** Your Balance is " + ((Account) account[accountId]).getAccountBalance());
481
- // try {
482
- // TimeUnit.SECONDS.sleep(2);
483
- // } catch (InterruptedException e) {
484
-
485
- // e.printStackTrace();
486
- // }
487
- // }
488
- // }
489
-
490
457
public static void deposit (Account [] account , int accountId ) {
491
458
Scanner inputAccountDeposit = new Scanner (System .in );
492
459
System .out .println (" Enter deposit amount: " );
0 commit comments