-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathLottoApplication.java
More file actions
23 lines (17 loc) · 1.03 KB
/
LottoApplication.java
File metadata and controls
23 lines (17 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.hee;
import com.hee.strategy.RandomGenerationStrategy;
import com.hee.view.InputView;
import com.hee.view.ResultView;
public class LottoApplication {
private static final String INPUT_MESSAGE_OF_PURCHASE_AMOUNT = "구입 금액을 입력해 주세요.";
private static final String INPUT_MESSAGE_OF_WINNING_NUMBER = "\n지난 주 당첨 번호를 입력해 주세요.";
public static void main(String[] args) {
LottoGame lottoGame = new LottoGame();
int purchaseAmount = InputView.inputInt(INPUT_MESSAGE_OF_PURCHASE_AMOUNT); // 구입 금액
ResultView.printTickets(lottoGame.buyTickets(purchaseAmount, new RandomGenerationStrategy())); // 티켓 구매
String winningNumberOfLastWeek = InputView.inputStringArray(INPUT_MESSAGE_OF_WINNING_NUMBER); // 지난 주 당첨 번호
LottoResult result = lottoGame.play(winningNumberOfLastWeek);
ResultView.printResult(result); // 당첨 결과
ResultView.printProfitRate(result, purchaseAmount); // 수익률 결과
}
}