Skip to content
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
eb33467
feat: 구입금액 입력 기능 구현
luzknar Aug 1, 2026
25a7a6d
feat: 기본 로또 숫자 생성 기능 구현
luzknar Aug 1, 2026
bb9a74e
feat: 로또 구입 금액에 따른 로또 발급 기능 구현
luzknar Aug 1, 2026
4bcc236
feat:구매한 로또들을 관리하는 일급컬렉션 Lottos 추가
luzknar Aug 1, 2026
183109c
feat: 출력 기능 구현
luzknar Aug 1, 2026
9f16875
feat: 메인메서드 구현
luzknar Aug 1, 2026
e66d10f
feat: 당첨 번호 입력 및 저장 구현
luzknar Aug 1, 2026
6791807
refactor: 입력 기능 View 내부로 이동
luzknar Aug 1, 2026
f0bb06e
refactor: 당첨 번호 정렬
luzknar Aug 1, 2026
16aad70
feat: 로또 1장당 몇 개의 숫자가 겹치는지 구하는 기능 구현
luzknar Aug 2, 2026
1925288
feat: 당첨 번호 비교 및 등수별 당첨 통계 집계 기능 구현
luzknar Aug 2, 2026
1fd4040
feat: 수익률 구하는 기능 구현
luzknar Aug 2, 2026
48c0c1d
feat: 당첨 통계 출력 기능 구현
luzknar Aug 2, 2026
6be5649
fix: InputView 버퍼 잔여 문제로 인한 당첨 번호 입력 오류 수정
luzknar Aug 2, 2026
e17cd36
feat: 보너스 볼 입력 기능 구현
luzknar Aug 2, 2026
464b224
feat: 2등+보너스볼 당첨자 구하는 기능 구현
luzknar Aug 2, 2026
76711b0
feat: 수동 로또 구입 입력 기능 구현
luzknar Aug 2, 2026
9c82f14
feat: 수동 로또 구매 기능 구현
luzknar Aug 2, 2026
63180a1
feat: 당첨 등수 관리 Enum 및 당첨 수 원시값 포장 객체 구현
luzknar Aug 3, 2026
a2e257b
refactor: Map과 Enum 기반의 로또 당첨 집계 로직으로 변경
luzknar Aug 3, 2026
88edef5
refactor: 하드코딩된 상금 상수 제거 및 Rank Enum, WinningStatistics 연동
luzknar Aug 3, 2026
a30b33a
feat: 리팩토링된 도메인 객체와 View 및 Main 연동
luzknar Aug 3, 2026
2bb1f54
Test: 맞춘 개수와 보너스볼 유무에 따라 올바른 Rank를 반환하는지 테스트
luzknar Aug 3, 2026
cdd23cf
Test: compareLottos() 실행 시 당첨 등수 별 수량이 Map에 정확히 집계되는지 테스트
luzknar Aug 3, 2026
a741178
refactor: 예외처리 추가
luzknar Aug 3, 2026
05a9d3d
test: 구매금액과 통계를 바탕으로 수익률이 올바르게 계산되는지 테스트
luzknar Aug 3, 2026
2f4ed32
test: 로또 객체 생성 시 예외 발생 검증 테스트 추가
luzknar Aug 4, 2026
1775991
refactor: 같은 기능을 하는 메서드 단순화
luzknar Aug 4, 2026
d145916
test: 수익률 테스트에서 금액을 로또 수량에 맞게 변경
luzknar Aug 4, 2026
c626494
refactor: Rank 필드에 fianl 제어자 추가
luzknar Aug 4, 2026
5b8dde5
refactor: 수동 로또 구입 및 당첨 번호 설정 로직을 PurchaseManage로 이동
luzknar Aug 4, 2026
0b6a05b
refactor: 구입 금액 입력 중 공백 및 문자 입력 시 예외처리 추가
luzknar Aug 4, 2026
d5f0598
refactor: 수동 로또 생성 로직을 makeManualLotto 메서드로 분리
luzknar Aug 4, 2026
023460d
refactor: 수동 구매 수량 입력 검증 예외처리 추가
luzknar Aug 4, 2026
7e26f3a
refactor: 수동 구매 수량 입력 검증 예외처리 내부로 이동
luzknar Aug 4, 2026
efe62fe
refactor: 수동으로 입력받는 로또에 대한 중복 검증 추가
luzknar Aug 5, 2026
bd23cfb
fix: 수익률 퍼센트 단위 계산 수정
luzknar Aug 5, 2026
ce67ece
refactor: 안쓰는 매개변수 제거
luzknar Aug 5, 2026
2e6e6f1
refactor: LottoNumber의 getLottoNumbers()에 방어적 복사 적용
luzknar Aug 5, 2026
f8ec6f5
refactor: 클래스명, 필드변수명 수정
luzknar Aug 6, 2026
1d02d5d
refactor: 구매 금액 및 수동수량을 검증과 수량 계산 책임을 갖는 객체 PurchaseAmount로 분리
luzknar Aug 7, 2026
69140af
refactor: 당첨 번호 및 보너스 번호 관리와 검증 책임을 WinningLotto로 이동
luzknar Aug 8, 2026
c6082f7
refactor: 수동구매 로직을 Lottos 내부로 이동 및 도메인 내 View 의존성 제거
luzknar Aug 8, 2026
5624c34
refactor: 당첨번호와 로또1 장 일치 개수 세는 기능 WinningLotto 내부로 이동
luzknar Aug 8, 2026
143eb9f
refactor: 구입금액에 대한 비즈니스 규칙 검증 추가
luzknar Aug 8, 2026
28a0430
refactor: WinnerNum 클래스 삭제 및 Integer타입으로 개수 관리
luzknar Aug 8, 2026
b1a420a
Test: 테스트 코드 수정
luzknar Aug 8, 2026
63db64c
refactor: 와일드카드 제거
luzknar Aug 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 로또 미션

----

### 기능 요구사항

- 로또 구입 금액을 입력하면 구입 금액에 해당하는 로또를 발급해야한다.
- 로또 1장의 가격은 1000원 이다.
- 로또 당첨 번호를 받아 일치한 번호 수에 따라 당첨 결과를 보여준다.
- 로또 2등을 위한 보너스볼을 추첨한다.
- 당첨 통계에 2등을 추가한다.(2등 당첨 조건은 당첨 번호 5개 일치 + 보너스 볼 일치다.)
- 사용자가 수동으로 추첨 번호를 입력할 수 있도록 해야한다.
- 입력한 금액, 자동 생성 숫자, 수동 생성 번호를 입력하도록 해야한다.
---

### 프로그래밍 요구사항

- 자바 코드 컨벤션을 지킨다.
- indent depth를 2를 넘지않도록 구현한다.
- 3항 연산자를 쓰지 않는다.
- else 예약어를 쓰지 않는다.
- 배열 대신 컬렉션을 사용한다.
- 축약 하지 않는다.
- 함수의 길이가 10라인을 넘지 않도록 구현한다.
- 모든 원시값과 문자열을 포장한다.
- 일급 컬렉션을 쓴다.
- Java Enum을 적용한다.


33 changes: 33 additions & 0 deletions src/main/java/Main.java

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

하나의 메서드에 쭉 로직이 작성되어있네요 🥲
메서드 분리를 통해 가독성도 높이고, 책임별로 로직을 묶어볼까요?

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import domain.*;
import view.InputView;
import view.ResultView;

import java.util.ArrayList;
import java.util.List;

public class Main {
public static void main(String[] args) {
int price = InputView.getPurchaseAmount();
int count = InputView.getManualPurchaseAmount();
List<LottoNumber> manualLottos = new ArrayList<>();
LottoParser lottoParser = new LottoParser();
for (int i = 0; i < count; i++) {
String input = InputView.getManualPurchasedLottos();

List<Integer> numbers = lottoParser.parseSingleLotto(input);
manualLottos.add(new LottoNumber(numbers));
}
PurchaseManage purchaseManage = new PurchaseManage();
Lottos lottos = purchaseManage.buyLottos(price, manualLottos);

ResultView.showNum(lottos);
String enteredWinningNumber = InputView.getWinningNumber();
int bonusNumber = InputView.getBonusNumber();

List<Integer> winningNumbers = lottoParser.setWinningNumber(enteredWinningNumber);
WinningStatistics winningStatistics = new WinningStatistics();
winningStatistics.compareLottos(winningNumbers, lottos, bonusNumber);
ProfitRate profitRate = new ProfitRate(price, winningStatistics);
ResultView.showStatistics(profitRate, winningStatistics);
}
}
48 changes: 48 additions & 0 deletions src/main/java/domain/LottoNumber.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package domain;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class LottoNumber {
private static final List<Integer> NUMBERS = new ArrayList<>();
static {
for (int i = 1; i <= 45; i++) {
NUMBERS.add(i);
}
}

private final List<Integer> lottoNumbers;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

정말 사소하지만, lottoNumber이라는 이름의 클래스가 lottoNumbers를 필드로 가지고 있는 것이 어색해 보일 수 있을 것 같아요.
수정이 꼭 필요한 부분은 아니지만 앞으로 클래스명, 필드명 등을 생성할 때 주의하시면 좋을 것 같습니다!


public LottoNumber() {
List<Integer> numbers = new ArrayList<>(NUMBERS);
Collections.shuffle(numbers);
this.lottoNumbers = new ArrayList<>(numbers.subList(0, 6));
Collections.sort(this.lottoNumbers);
}

public LottoNumber(List<Integer> manualNumbers) {
validateLottoNumber(manualNumbers);
this.lottoNumbers = new ArrayList<>(manualNumbers);
Collections.sort(this.lottoNumbers);
}

private void validateLottoNumber(List<Integer> manualNumbers) {
for (int number : manualNumbers) {
validateNumber(number);
}
if (manualNumbers.size() != 6) {
throw new IllegalArgumentException("로또 번호는 6개여야 합니다.");
}
}

private void validateNumber(int number) {
if (number < 1 || number > 46) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

범위가 잘못된 것 같아요! number > 45 로 수정이 필요해 보입니다

throw new IllegalArgumentException("로또 번호는 1부터 45까지여야 합니다.");
}
}

public List<Integer> getLottoNumbers() {
return lottoNumbers;
}
}
27 changes: 27 additions & 0 deletions src/main/java/domain/LottoParser.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package domain;

import java.util.*;

public class LottoParser {
public List<Integer> setWinningNumber(String enteredWinningNumber) {
List<Integer> winningNumber = new ArrayList<>();
String[] item = enteredWinningNumber.split(",");
for (int i = 0; i < item.length; i++) {
item[i] = item[i].trim();
winningNumber.add(Integer.parseInt(item[i]));
}
Collections.sort(winningNumber);

return winningNumber;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

당첨 숫자들은 Lotto Number 검증을 거치지 않고 있는 것 같아요🥲


public List<Integer> parseSingleLotto(String input) {
List<Integer> lottoNumbers = new ArrayList<>();
String[] items = input.split(",");
for (String item : items) {
lottoNumbers.add(Integer.parseInt(item.trim()));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

       for (String value : input.split(",")) {
            numbers.add(Integer.parseInt(value.trim()));
        }

이렇게 줄일 수 있겠군요!

추가로 LottoParser 클래스의 역할이 무엇인가요?
단순히 문자열 파싱을 한다기에는, Integer list로 변환도 하고, sort도 해주어 많은 일을 하고있는 것 같아서요 !

Collections.sort(lottoNumbers);
return lottoNumbers;
}
}
18 changes: 18 additions & 0 deletions src/main/java/domain/Lottos.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package domain;

import java.util.List;

public class Lottos {
private final List<LottoNumber> lottos;

public Lottos(List<LottoNumber> lottos) {
this.lottos = lottos;
}

public int size() {
return lottos.size();
}
public List<LottoNumber> getLottos() {
return lottos;
}
}
27 changes: 27 additions & 0 deletions src/main/java/domain/MatchCount.java

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

로또 일치 개수를 객체로 만드신 이유가 무엇인가요?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

당시에는 당첨 번호와 비교하여 일치 개수를 세는 기능이 비중있게 느껴져서 LottoParser 처럼 단일 역할을 하는 객체로 분리했습니다. 하지만 각 클래스의 역할과 책임을 정리해보니 이미 당첨번호를 필드값으로 가지고있는 당첨번호 객체에서 충분히 처리할 수 있는 로직이었고, 굳이 별도으 클래스로 분리할 필요까지는 없었던 것 같습니다. 해당 클래스는 제거하는 방향으로 개선했습니다!

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package domain;

import java.util.List;

public class MatchCount {
int count = 0;
public void comparingLotto (List<Integer> lottoNumbers, List<Integer> winningNumbers) {
count = 0;
for (int i = 0; i < 6; i ++) {
compareNumbers(lottoNumbers, winningNumbers, i);
}
}

public void compareNumbers(List<Integer> lottoNumbers, List<Integer> winningNumbers, int i) {
if (lottoNumbers.contains(winningNumbers.get(i))) {
count++;
}
}

public int getCount() {
return count;
}

public boolean hasBonusNumber(List<Integer> lottoNumber, int bonusNumber) {
return lottoNumber.contains(bonusNumber);
}
}
28 changes: 28 additions & 0 deletions src/main/java/domain/ProfitRate.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package domain;

import java.util.Map;

public class ProfitRate {
private final int price;
private final WinningStatistics winningStatistics;

public ProfitRate(int price, WinningStatistics winningStatistics) {
this.price = price;
this.winningStatistics = winningStatistics;
}

public long getTotalProfit() {
long totalProfit = 0;
Map<Rank, WinnerNum> statistics = winningStatistics.getWinningStatistics();

for (Rank rank : statistics.keySet()) {
int count = statistics.get(rank).getWinnerNum();
totalProfit += (long) rank.getPrize() * count;
}
return totalProfit;
}

public double getProfitRate() {
return (double) getTotalProfit() / price;
}
}
20 changes: 20 additions & 0 deletions src/main/java/domain/PurchaseManage.java

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 클래스의 역할에 대해서도 쭉 리스트업해보면 좋을 것같아요.
PurchaseManager가 하고있는 역할이 많은 것 같아요!

오히려 Lotto List를 필드로 가지고있는 Lottos가 가져야할 역할도 이 클래스가 가지고 있는 것 같은데 일단 리스트업 후 다른 여러 클래스들로 적절히 분리해보시죵

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package domain;

import java.util.ArrayList;
import java.util.List;

public class PurchaseManage {
private static final int LOTTO_PRICE = 1000;

public Lottos buyLottos(int price, List<LottoNumber> manualLottos) {
int totalCount = price / LOTTO_PRICE;
int automaticLottoCount = totalCount - manualLottos.size();

List<LottoNumber> purchaseLottos = new ArrayList<>(manualLottos);

for (int i = 0; i < automaticLottoCount; i++) {
purchaseLottos.add(new LottoNumber());
}
return new Lottos(purchaseLottos);
}
}
37 changes: 37 additions & 0 deletions src/main/java/domain/Rank.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package domain;

public enum Rank {
FIRST_PLACE(6, 2000000000, false),
SECOND_PLACE_BONUS(5, 30000000, true),
SECOND_PLACE(5, 1500000, false),
THIRD_PLACE(4, 50000, false),
FOURTH_PLACE(3, 5000, false),
MISS(0, 0, false);

private int matchBallNum;
private int prize;
private boolean hasBonusBall;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 필드들은 변하지 않는 값이네요! 어떤 키워드를 붙일 수 있을까요?


Rank(int matchBallNum, int prize, boolean hasBonusBall) {
this.matchBallNum = matchBallNum;
this.prize = prize;
this.hasBonusBall = hasBonusBall;
}

public static Rank getRank(int matchBallNum, boolean hasBonusBall) {
if (matchBallNum == FIRST_PLACE.getMatchBallNum()) { return FIRST_PLACE; }
if (matchBallNum == SECOND_PLACE_BONUS.getMatchBallNum() && hasBonusBall) { return SECOND_PLACE_BONUS; }
if (matchBallNum == SECOND_PLACE.getMatchBallNum() && !hasBonusBall) { return SECOND_PLACE; }
if (matchBallNum == THIRD_PLACE.getMatchBallNum()) { return THIRD_PLACE; }
if (matchBallNum == FOURTH_PLACE.getMatchBallNum()) { return FOURTH_PLACE; }
return MISS;
}

public int getMatchBallNum() {
return matchBallNum;
}

public int getPrize() {
return prize;
}
}
16 changes: 16 additions & 0 deletions src/main/java/domain/WinnerNum.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package domain;

public class WinnerNum {
private int winnerNum;
public WinnerNum(int winnerNum) {
this.winnerNum = winnerNum;
}

public int getWinnerNum() {
return winnerNum;
}

public void increase() {
winnerNum++;
}
}
26 changes: 26 additions & 0 deletions src/main/java/domain/WinningStatistics.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package domain;

import java.util.*;

public class WinningStatistics {
Map<Rank, WinnerNum> winningStatistics = new HashMap<>();

MatchCount matchCount = new MatchCount();
public WinningStatistics() {
for (Rank rank : Rank.values()) {
winningStatistics.put(rank, new WinnerNum(0));
}
}

public void compareLottos (List<Integer> winningNumbers, Lottos lottos, int bonusNumber) {
for (LottoNumber lottoNumber : lottos.getLottos()) {
matchCount.comparingLotto(lottoNumber.getLottoNumbers(), winningNumbers);
Rank rank = Rank.getRank(matchCount.getCount(), matchCount.hasBonusNumber(lottoNumber.getLottoNumbers(), bonusNumber));
winningStatistics.get(rank).increase();
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

구조가 조금 어색해보입니다ㅠㅠ

전체 코멘트에도 작성했지만 객체를 getter로 가져와서 계산은 다른 곳에서 하는 부분이 잘못된 책임 분리라고 느껴졌어요
상수를 상수로 두지 않고 객체로 감싸는 이유가 무엇인가요? 전체 코멘트에 질문을 남기긴했는데 먼저 답변드리자면 간단하게는 캡슐화를 위함이라고 생각합니다.

캡슐화를 하는 것 까지는 잘 해주셨는데, 이 부분 뿐 만 아니라 다른 코드 전반에도 getter가 많이 사용되고 있어요🥲
getter를 남용하면 사실 캡슐화로 필드를 보호하는 목적이 옅어집니다.
그래서 객체로 잘 감싸고, 해당 객체의 동작은 해당 클래스 내에 구현하는 것이 좋아요!

공부할 부분을 염두하고 대략적으로 작성해보았는데, 구체적으로 학습해보시면 도움이 될 것 같아요!
학습하신 내용 역시 코멘트에 달아 공부한 바를 설명하는 습관을 들이면 좋을 것 같습니다👍


public Map<Rank, WinnerNum> getWinningStatistics() {
return winningStatistics;
}
}
38 changes: 38 additions & 0 deletions src/main/java/view/InputView.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package view;

import java.util.Scanner;

public class InputView {
private static Scanner scanner = new Scanner(System.in);

public static int getPurchaseAmount() {
System.out.println("구입금액을 입력해 주세요.");
int purchaseAmount = Integer.parseInt(scanner.nextLine());
return purchaseAmount;
}
Comment on lines +12 to +21

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1등의 음수는 입력 가능하네요. 검증 로직이 부족합니다!

추가로 입력값에 대한 검증을 할 수 있는 방법은 여러가지가 있습니다.

  1. InputView에서의 검증하는 방법
  2. Application.java 파일 내부에서 검증하는 방법
  3. 입력받은 값을 단순히 상수나 원시값으로 들고 있기보다, 해당 값을 의미 있는 객체로 캡슐화하고 그 객체 내부에서 검증하는 방법

지수님은 어느 위치에서 검증하는 것이 적절하다 판단하셨나요?
만일 현재의 방법을 유지하기로 판단하셨거나, 셋중 한가지 방법으로 수정하신다면 그 이유에대해서 설명해주세요!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3번으로 검증하는 것이 적절한 것 같습니다. 객체가 생성되는 시점에서 생성자 내부에서 스스로 유효성을 검증함으로써, 생성된 객체가 올바른 상태라는 것을 보장할 수 있기 때문입니다.
따라서 PurchaseAmount라는 구입금액 정보를 가지고 있는 객체를 만들었습니다. 그리고 인풋에서 정수 변환 가능 여부같은 형식검증만 진행하고 비즈니스 규칙 검증은 도메인 객체가 담당하도록 하였습니다!


public static int getManualPurchaseAmount() {
System.out.println("수동으로 구매할 로또 수를 입력해 주세요.");
int manualPurchaseLottos = Integer.parseInt(scanner.nextLine());
return manualPurchaseLottos;
}

public static String getManualPurchasedLottos() {
System.out.println("수동으로 구매할 번호를 입력해 주세요.");
String manualPurchasedLotto = scanner.nextLine();
return manualPurchasedLotto;
}

public static String getWinningNumber() {
System.out.println("지난 주 당첨 번호를 입력해주세요.");
String enteredWinningNumber = scanner.nextLine();
return enteredWinningNumber;
}

public static int getBonusNumber() {
System.out.println("보너스 볼을 입력해 주세요.");
int bonusNumber = Integer.parseInt(scanner.nextLine());
return bonusNumber;
}

}
24 changes: 24 additions & 0 deletions src/main/java/view/ResultView.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package view;

import domain.*;

public class ResultView {
public static void showNum(Lottos lottos) {
System.out.printf("%d개를 구매했습니다.", lottos.size());
System.out.println();
for (LottoNumber lottoNumber : lottos.getLottos()) {
System.out.println(lottoNumber.getLottoNumbers());
}
}

public static void showStatistics(ProfitRate profitRate, WinningStatistics winningStatistics) {
System.out.println("당첨 통계");
System.out.println("---------");
System.out.println("3개 일치 (5000원)-" + winningStatistics.getWinningStatistics().get(Rank.FOURTH_PLACE).getWinnerNum());
System.out.println("4개 일치 (50000원)-" +winningStatistics.getWinningStatistics().get(Rank.THIRD_PLACE).getWinnerNum());
System.out.println("5개 일치 (1500000원)-" + winningStatistics.getWinningStatistics().get(Rank.SECOND_PLACE).getWinnerNum());
System.out.println("5개 일치, 보너스 볼 일치(30000000원)-" + winningStatistics.getWinningStatistics().get(Rank.SECOND_PLACE_BONUS).getWinnerNum());
System.out.println("6개 일치 (2000000000원)-" + winningStatistics.getWinningStatistics().get(Rank.FIRST_PLACE).getWinnerNum());
System.out.println("총 수익률은 " + profitRate.getProfitRate() + "입니다.");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수익률 계산 시 % 단위로 나타내려면 100을 곱해야할 것 같은데, 미션 내용을 확인해보지 못해서 😅...
현재의 출력 방법이 맞나요??

}
}
Loading