[로또] 박현규 미션 제출합니다.#1
Open
ParkHyeonkyu wants to merge 7 commits intoJava-JavaScript-Language-Stuty:mainfrom
Open
[로또] 박현규 미션 제출합니다.#1ParkHyeonkyu wants to merge 7 commits intoJava-JavaScript-Language-Stuty:mainfrom
ParkHyeonkyu wants to merge 7 commits intoJava-JavaScript-Language-Stuty:mainfrom
Conversation
예외를 잡아 줄 Lotto.js와 LottoTest.js 코드 임시 작성
입출력 구현으로 가격 구매 및 예외 처리 구현
Random을 활용한 로또 생성 구현
당첨 번호와 보너스 번호 입력기능 구현
object를 활용한 수익률 계산 구현
수익률을 계산해주는 PrizeCheck 클래스를 분리
중복되는 함수를 하나로 합침
GeumZu
reviewed
Feb 28, 2025
| Console.print(`5개 일치, 보너스 볼 일치 (30,000,000원) - ${result['5개 일치 (보너스 볼 일치)']}개`); | ||
| Console.print(`6개 일치 (2,000,000,000원) - ${result['6개 일치']}개`); | ||
| } | ||
| } |
There was a problem hiding this comment.
App.js 부분에서 사용자 UI 부분만 깔끔하게 정리해서 작성하면 좀 더 코드 분리가 잘 될 것 같습니다! 예외처리문 까지 App에 넣을 필요는 없을 것 같아요!
| lottos.forEach(lotto => Console.print(`[${lotto.getNumbers().join(", ")}]`)); | ||
| } | ||
|
|
||
| printResultsAndRevenueRate(purchaseAmount, lottos, winningNumbers, bonusNumber) { |
There was a problem hiding this comment.
여기 아래 부분부터는 PrizeChecker 클래스가 아니라 왜 App 클래스에 구현하신 건지 궁금합니다! 개인적으로 수익률 계산하는 곳에 묶어 놓았으면 더 보기 좋지 않을까 싶어서
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
신경써서 구현한 부분
코드 분리를 시도해보았습니다.
수익률을 계산하는 PrizeChecker.js를 새로 만들었습니다
피드백이 필요한 부분
사용해야 할 변수와 메서드가 많아지다보니 이름 짓는게 어려웠습니다.
제가 봐도 헷갈리는 부분이 많더라구요,,
그리고 필요한 함수를 하나하나 찾아가며 끼워맞추다보니 쾌적한 느낌이 들지는 않는 것 같습니다
내가 고려한 예외