-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathMain.java
38 lines (26 loc) · 1.12 KB
/
Main.java
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
import domain.Input;
import domain.GenerateLotto;
import domain.WinningLotto;
import exception.Lotto;
import exception.Money;
import view.Print;
import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
GenerateLotto lotto = new GenerateLotto();
WinningLotto winningLotto = new WinningLotto();
Print print = new Print();
Input input = new Input();
int purchaseAmount = input.setPurchaseAmount();
int manualCount = input.setManualCount();
if (manualCount > 0) {
lotto.getManualLotto(purchaseAmount, manualCount);
}
ArrayList<ArrayList<Integer>> totalLottos = lotto.getLotto(lotto.getRemainingMoney(purchaseAmount, manualCount));
print.printPurchasedLottoCount(manualCount, totalLottos);
ArrayList<Integer> winningNumbers = input.setWinningNumber();
int bonusNumber = input.setBonusNumber(winningNumbers);
winningLotto.totalCheckLotto(totalLottos, winningNumbers, bonusNumber);
print.printWinningCount(winningLotto.winningCount, winningLotto.calculateRate(purchaseAmount));
}
}