[행성 로또] 박소영 미션 제출합니다.#35
Open
soyeong0115 wants to merge 12 commits intowoowacourse-precourse:mainfrom
Open
Conversation
added 12 commits
January 10, 2026 13:24
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.
🪐 javascript-planetlotto-precourse
우테코 로또 발매기인 행성 로또를 구현한다.
📝 구현 기능 목록
1. 로또 구입 금액 입력 받기
구입금액을 입력해 주세요.출력잘못된 입력값일 경우 throw문을 통해 예외 발생
2. 발행한 로또 수량 출력하기
2개를 구매했습니다.출력3. 발행한 로또 번호 출력하기
로또 발행하기
Random. pickUniqueNumbersInRange()활용)4. 당첨 번호 입력 받기
당첨 번호를 입력해 주세요.출력쉼표(,)를 기준으로 번호 구분하기
잘못된 입력값일 경우 throw문을 통해 예외 발생
5. 보너스 번호 입력 받기
보너스 번호를 입력해 주세요.출력잘못된 입력값일 경우 throw문을 통해 예외 발생
6. 당첨 내역 출력하기
7. 에러 메시지 출력 후 재입력 받기
기능 요구 사항
본 프로그램의 목적은 기능 구현에 그치는 것이 아니라 프리코스에서 학습한 개발 방식(문제 분해, 설계, TDD)이 코드에 드러나는 것에 있다.
입력/출력 역할은 제공된 InputView, OutputView에서 수행하며 기존 메서드를 수정, 삭제할 수 없다.
로또 번호의 숫자 범위는 1~30까지이다.
1개의 로또를 발행할 때 중복되지 않는 5개의 숫자를 뽑는다.
당첨 번호 추첨 시 중복되지 않는 숫자 5개와 보너스 번호 1개를 뽑는다.
당첨은 1등부터 5등까지 있다. 당첨 기준과 금액은 아래와 같다.
1등: 5개 번호 일치 / 100,000,000원
2등: 4개 번호 + 보너스 번호 일치 / 10,000,000원
3등: 4개 번호 일치 / 1,500,000원
4등: 3개 번호 일치 + 보너스 번호 일치 / 500,000원
5등: 2개 번호 일치 + 보너스 번호 일치 / 5,000원
로또 구입 금액을 입력하면 구입 금액에 해당하는 만큼 로또를 발행해야 한다.
로또 1장의 가격은 500원이다.
당첨 번호와 보너스 번호를 입력받는다.
사용자가 구매한 로또 번호와 당첨 번호를 비교하여 당첨 내역을 출력하고 로또 게임을 종료한다.
사용자가 잘못된 값을 입력할 경우 "[ERROR]"로 시작하는 메시지와 함께 Error를 발생시키고 해당 메시지를 출력한 다음 해당 지점부터 다시 입력을 받는다.