[로또만들기] 남지윤 3주차 미션 제출입니다. #2
Open
yuninam2128 wants to merge 11 commits intoJava-JavaScript-Language-Stuty:mainfrom
Open
[로또만들기] 남지윤 3주차 미션 제출입니다. #2yuninam2128 wants to merge 11 commits intoJava-JavaScript-Language-Stuty:mainfrom
yuninam2128 wants to merge 11 commits intoJava-JavaScript-Language-Stuty:mainfrom
Conversation
Update README.md
로또 구입 금액, 당첨 번호, 보너스 번호를 입력할 수 있는 기능을 추가하였다.
클래스 설계, 코드 흐름을 추가하였다.
랜덤으로 로또를 발행해 저장 및 출력하는 기능을 추가하였다.
당첨 번호를 쉼표 기준으로 구분하고, 발행한 로또 개수를 구하는 기능을 추가하였다.
일치하는 숫자를 검사하고 숫자를 카운트하는 기능을 추가하였다.
총 수익을 계산하고 투자 금액으로 나눠, 소수점 둘째 자리까지 반올림하는 기능을 추가하였다.
소수점 둘째자리 '까지' 가 아니라, 소수점 둘째 자리 '에서' 반올림 되도록 수정하였다.
예외를 처리하는 기능을 추가하였다.
오류가 난 뒤 다시 입력받는 기능을 추가했습니다.
README.md 업데이트
GeumZu
reviewed
Feb 28, 2025
| return this.getBonusNumber(userLotto); // 재귀적으로 다시 호출 | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
App 클래스에서는 사용자와 맞닿아있는 인터페이스 (UI) 부분을 구현하는 게 가독성이 좋아보일 것 같아요. 사용자가 디폴트로 거쳐야 하는 기능의 UI만 골라서 구현하시면 코드가 훨씬 간결해질 것 같습니다! 저의 경우는 예외처리 및 결과 출력 부분 등 기능별로 파일을 여러개 만들어서 별도로 구현하였습니다
| getNumbers(){ | ||
| return this.#numbers | ||
| } | ||
| } |
There was a problem hiding this comment.
Lotto 클래스에서는 로또 티켓이 가진 고유의 성질들을 구현하시면 좋을 것 같아요. 저는 로또 번호 6를 랜덤으로 뽑는 것이라던지 당첨번호를 입력받을 때의 예외 처리를 이 부분에서 구현하였습니다.
|
|
||
| return this.counts; | ||
| } | ||
|
|
There was a problem hiding this comment.
결과 출력하는 부분의 구현을 이부분에 해놓고 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.
오류가 난 뒤 다시 입력받아야 하는 조건을 뒤늦게 확인하고 아직 고치지 못했습니다. -> 뒤늦게 수정했습니다..
피드백이 필요한 부분