-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
44 lines (39 loc) · 1.25 KB
/
Main.java
File metadata and controls
44 lines (39 loc) · 1.25 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
import java.util.*;
import java.util.List;
import java.util.Scanner;
import java.text.*;
public class Main {
public Account acct;
static public Scanner scan = new Scanner(System.in);
static HashMap<String, Account> accounts = MiniLiquidation.accounts;
public static void main(String[] args) {
System.out.println("Hello Mini Liquidation!");
MiniLiquidation program = new MiniLiquidation();
program.scan = scan;
System.out.print("please enter your account: ");
String handle = scan.nextLine();
if (!accounts.containsKey(handle)) {
System.out.print("please enter your liquidation: ");
String liquid = scan.nextLine();
AcctType type = AcctType.FIFO;
switch (liquid) {
case "FIFO":
type = AcctType.FIFO;
break;
case "LIFO":
type = AcctType.LIFO;
break;
default:
break;
}
accounts.put(handle, new Account(handle, type));
}
program.acct = accounts.get(handle);
while (true) {
program.inputTrade();
System.out.println();
program.display();
System.out.println();
}
}
}