-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
58 lines (50 loc) · 1.97 KB
/
Copy pathMain.java
File metadata and controls
58 lines (50 loc) · 1.97 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
import java.util.Scanner;
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
//TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
// to see how IntelliJ IDEA suggests fixing it.
System.out.println("\n Menu");
System.out.println("1.Create");
System.out.println("2.Credit");
System.out.println("3.Debit");
System.out.println("4.Tranfer");
System.out.println("5.Show account info");
System.out.println("6.Exit");
int choose=input.nextInt();
input.nextLine();
System.out.println("Choose accout type");
System.out.println("1. Savings accout");
System.out.println("2. Current Account");
System.out.println("3. Deposit premium Account");
System.out.println(("Enter your choice"));
int choice = input.nextInt();
input.nextLine();
System.out.println("Enter your AccountId");
String accountId = input.nextLine();
System.out.println("Enter your AccountName");
String accountName = input.nextLine();
System.out.println("Password set");
String password = input.nextLine();
System.out.println("Enter initial balance");
double initialBalance = input.nextDouble();
input.nextLine();
Account ac=null;
if(choice==1){
ac=new Current(accountId,accountName,password,initialBalance);
}
else if(choice==2){
ac=new Savings(accountId,accountName,password,initialBalance);
}
else if (choice==3){
ac=new Premium(accountId,accountName,password,initialBalance);
}
else{
System.out.println("Invalid choice");
}
if(ac!=null){
}
}
}