Skip to content

3주차미션#1

Open
piamin04 wants to merge 4 commits into
mainfrom
develop
Open

3주차미션#1
piamin04 wants to merge 4 commits into
mainfrom
develop

Conversation

@piamin04

Copy link
Copy Markdown
Owner

No description provided.

기능 구현 설명
로또 구입 금액 입력 및 예외 처리 기능 추가
로또 개수 구하기 및 로또 발행

@daeGULLL daeGULLL left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

아주아주 깔끔한 코드였어용!! 저번에 비해 어마어마하게 실력이 느신것 같아서 감탄햇슴니다..ㅎㅎ 짱 대단하심 마지막 주차 과제 어려운데 다 같이 힘내봐용..ㅠㅠ

results.put(4, 0);
results.put(5, 0);
results.put(6, 0);
results.put(7, 0); // 5개 + 보너스

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

빠른 조회 및 입력을 신경써서 map을 한것 굉장히 좋은 시도라고 생각합니다!! 그런데 map이 은근 무거운편이라 길이 5짜리 배열을 쓰셔도 될것 같아용 이건 제 개인적인 코드 취향이라 무시하셔도 됨~~

if (winningNumbers.contains(num)) {
count++;
}
}

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문 말고 .stream()을 활용해보셔도 좋을 것 같아요! 더 간결하게 나올수도 있슴다


public class InputView {
public static int readMoney() {
System.out.println("구입금액을 입력해 주세요.");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

이런 시스템 메세지들을 enum으로 따로 빼서 관리하셔도 좋을 것 같아용!!

throw new IllegalArgumentException("구입 금액은 1,000원 단위여야 합니다.");
}
return Integer.parseInt(input);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

이런 validate 함수들은 뷰에 넣으면 조금 부적합할수도 있을 것 같아요, 따로 Validator파일을 만들어서 Validator 클래스 아래로 여러 검증 메서드를 가지게 해도 될 것같아요!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants