Skip to content

Conversation

@hyojin-120
Copy link

제가 아직 아는게 없어서 자바 수업 때 배운거랑 강의자료 참고해서 틀은 잡아봤는데 세부 코드는 아직 채우지 못했습니다..

@dh2906
Copy link

dh2906 commented Sep 30, 2025

코드 작성은 다른 PR을 보시고 코드 참고해주시면 될 것 같아요.
아마 시간을 매우 많이 투자해야 할거에요.... 그치만 그로 인해 얻는 것은 확실히 있으니 계속 열심히 해주시길 바랍니다~!!

Comment on lines +8 to +12
Scanner sc = new Scanner(System.in);
//1.자동차 이름 입력하기
System.out.println("경주할 자동차 이름을 입력하세요.(이름은 쉽표(,) 기준으로 구분합니다.)");
String input = sc.nextLine();
String[] carNames = input.split(",");
Copy link

Choose a reason for hiding this comment

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

기능 별로 클래스와 함수를 나눠주시는 게 좋을 것 같아요!

Comment on lines +19 to +21
if (attempts <= 0) {

}
Copy link

Choose a reason for hiding this comment

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

이런 경우일때는 throw new IllegalArgumentException("시도 횟수에 음수가 들어올 수 없습니다."); 와 같이 작성해주시면 될 것 같아요.

}
//3.경주 실행
System.out.println("실행 결과");
for (int i = 0; i < attempts; ++) {
Copy link

Choose a reason for hiding this comment

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

증감식 부분에 ++ 연산자만 들어와있어요!

Suggested change
for (int i = 0; i < attempts; ++) {
for (int i = 0; i < attempts; i++) {

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