-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathLottoApplication.java
More file actions
34 lines (24 loc) · 1.22 KB
/
LottoApplication.java
File metadata and controls
34 lines (24 loc) · 1.22 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
package lotto;
import calculator.Operator;
import view.InputView;
import view.OutputView;
import java.util.ArrayList;
import java.util.List;
import static lotto.Lotto.LOTTO_PRICE;
public class LottoApplication {
public static void main(String[] args) {
int lottoPurchaseAmount = InputView.showLottoPurchaseAmountInput();
int totalLottoCount = Operator.DIVIDE.formula.apply(lottoPurchaseAmount, LOTTO_PRICE);
int manualLottoCount = InputView.showManualLottoCountInput();
List<Lotto> lottos = new ArrayList<>(InputView.showManualLottoNumbersInput(manualLottoCount));
int autoLottoCount = totalLottoCount - manualLottoCount;
lottos.addAll(LottoNumberGenerator.generateLottoNumbers(autoLottoCount));
OutputView.showTotalLottoCount(manualLottoCount, autoLottoCount);
OutputView.showGeneratedLottoNumber(lottos);
Lotto winningLotto = InputView.showWinningLottoNumbersInput();
Integer bonusNumber = InputView.showLottoBonusNumberInput();
LottosResult lottosResult = new LottosResult(lottos, winningLotto, bonusNumber);
OutputView.showLottoRankResult(lottosResult);
OutputView.showTotalYieldRate(lottosResult.getTotalYieldRate());
}
}