forked from Nitheesh-SG/BankApllication
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBankApplication.java
More file actions
81 lines (79 loc) · 3 KB
/
BankApplication.java
File metadata and controls
81 lines (79 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
@Banking application - With the help of this application we can create new bank
account and other banking operation's.
@Author - Nitheesh G.
@Created at - 02-11-2021
@Updated at - 02-16-2021
@Reviewed by - Anto
*/
package bankapplication;
import java.util.Scanner;
public class BankApplication {
public static void main(String[] args) {
@SuppressWarnings("resource")
Scanner input=new Scanner(System.in);
BankingOperation bankingoperation=new BankingOperation();
UserInterest userinterest=new UserInterest();
UserTransactionHistory usertransactionhistory=new UserTransactionHistory();
System.out.println("Welcome to the Nitheesh's online banking service's :");
while(true)
{
try
{
System.out.println("Enter the option for Banking operation");
System.out.println("1.Create new Bank Account");
System.out.println("2.Deposit Your Amount");
System.out.println("3.Withraw Your Amount");
System.out.println("4.To calculate Interest Amount for your Loan");
System.out.println("5.To view Your Account Details");
System.out.println("6.To view you're Transaction History");
System.out.println("7.Exit the Banking operation");
String Userchoice=input.next();
switch(Userchoice)
{
case "1":
bankingoperation.CreateNewBankAccount();
break;
case "2":
bankingoperation.DepositeUserMoney();
break;
case "3":
bankingoperation.WithdrawUserMoney();
break;
case "4":
System.out.println("Please choose the Below option's :\n1.Simple Interest\n2.Compound Interest\n3.Main menu\n4.Exit\n");
String InterestOption=input.next();
switch(InterestOption)
{
case "1":
userinterest.calculatesimpleinterest();
break;
case "2":
userinterest.calculatecompoundinterest();
break;
case "3":
break;
case "4":
System.exit(0);
}
break;
case "5":
bankingoperation.DisplayUserAccountDetails();
break;
case "6":
usertransactionhistory.usertransactionhistory();
break;
case "7":
System.out.println("************ Thank you for using our service! Have a GREAT DAY **************");
System.exit(0);
default:
throw new InValidInputException("Please Enter the correct choice.\n");
}
}
catch(InValidInputException e)
{
System.out.println("You're enter the invalid choice.\n"+e);
}
}
}
}