Skip to content

[정승현_BackEnd]1주차 과제 제출#6

Open
jungseunghyun0415 wants to merge 1 commit intoBCSDLab-Edu:mainfrom
jungseunghyun0415:main
Open

[정승현_BackEnd]1주차 과제 제출#6
jungseunghyun0415 wants to merge 1 commit intoBCSDLab-Edu:mainfrom
jungseunghyun0415:main

Conversation

@jungseunghyun0415
Copy link
Copy Markdown

No description provided.

@jungseunghyun0415 jungseunghyun0415 changed the title 1주차 과제 제출 [정승현_BackEnd]1주차 과제 제출 Mar 30, 2026
Copy link
Copy Markdown

@ImTotem ImTotem left a comment

Choose a reason for hiding this comment

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

과제 진행 요구사항에 "기능을 구현하기 전 docs/README.md에 구현할 기능 목록을 정리해 추가한다"가 있어요. 구현한 기능들을 정리해서 채워보면 좋겠습니다.

Comment on lines +2 to +3
import java.util.Scanner;
import java.util.Random;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

프로그래밍 요구사항에 "JDK에서 제공하는 Random 및 Scanner API 대신 camp.nextstep.edu.missionutils의 Randoms 및 Console API를 사용하여 구현해야 한다"고 되어 있어요. 이 부분은 꼭 변경이 필요합니다.

Comment on lines +10 to +13
int n = sc.nextInt();
String[][] car = new String[n][2];

int set = sc.nextInt();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

기능 요구사항에서 입력 순서는 자동차 이름(쉼표 구분) → 시도 횟수 순서인데, 현재 코드는 자동차 수 → 시도 횟수 → 이름 순서로 받고 있어요. 입출력 예시를 다시 확인해보면 좋겠습니다.

Comment on lines +20 to +27
for(int i = 0; i < set; i++) {
for(int j = 0; j < n; j++) {
int num = r.nextInt(10);
if(num >= 4) {
car[j][1] += "-";
}
}
}
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

Choose a reason for hiding this comment

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

"사용자가 잘못된 값을 입력할 경우 IllegalArgumentException을 발생시킨 후 애플리케이션은 종료되어야 한다"는 요구사항이 있는데, 입력 검증과 예외 처리 로직이 빠져 있어요.

"자동차 이름은 5자 이하만 가능하다"는 요구사항에 대한 검증 로직도 추가해보면 좋겠습니다.

Comment on lines +20 to +27
for(int i = 0; i < set; i++) {
for(int j = 0; j < n; j++) {
int num = r.nextInt(10);
if(num >= 4) {
car[j][1] += "-";
}
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

프로그래밍 요구사항에 "indent depth를 3이 넘지 않도록 구현한다"가 있는데, 여기서 depth가 4까지 들어가고 있어요. 메서드를 분리하면 depth를 줄일 수 있습니다.

Comment on lines +10 to +13
int n = sc.nextInt();
String[][] car = new String[n][2];

int set = sc.nextInt();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

n, r, sc, set 같은 변수명이 의미를 파악하기 어려워요. carCount, tryCount 같이 의미가 드러나는 이름을 쓰면 코드를 읽기 더 편해집니다.

}
}

System.out.print("우승자: ");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

출력 형식이 요구사항의 "최종 우승자 : pobi, jun"과 다르고, 공동 우승자도 쉼표로 구분해야 해요. 입출력 예시를 한 번 더 확인해보면 좋겠습니다.

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