Skip to content

Conversation

@audgk54587
Copy link

No description provided.

@audgk54587 audgk54587 changed the title [황명하_BackEnd] PR 제출합니다 [황명하_BackEnd] 1주차 과제 제출합니다 Mar 25, 2025
Copy link

@dradnats1012 dradnats1012 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

Choose a reason for hiding this comment

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

사용하지 않는 클래스 같은데 지워주면 좋을 것 같아요!

Copy link
Author

Choose a reason for hiding this comment

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

지웠습니다!

{
// TODO: 프로그램 구현

Scanner sc = new Scanner(System.in);

Choose a reason for hiding this comment

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

미션 요구사항에 나와있는 Console.readLine() 을 사용해주세요!

Copy link
Author

Choose a reason for hiding this comment

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

사용하여 수정하였습니다!


public class Application
{
public static void main(String[] args)

Choose a reason for hiding this comment

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

main 메서드 내에서 너무 많은 역할을 가지고 있는 것 같아요!
각 코드의 역할을 좀 더 알아보기 쉽게 메서드를 분리해보는게 어떨까요?

Copy link
Author

Choose a reason for hiding this comment

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

분리완료했습니다!

cars.add(new Car(name));
}

int count=sc.nextInt();

Choose a reason for hiding this comment

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

이상한 입력이 들어오면 어떻게 될까요?

Comment on lines +36 to +38
if(car.getPosition()>win) {
win = car.getPosition();
}

Choose a reason for hiding this comment

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

depth가 깊어지는것 같은데 메서드로 뺄 수 있을 것 같아요~!

Copy link
Author

Choose a reason for hiding this comment

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

분리했습니다!

winCars.add(car.getName());
}
}
System.out.print("winner"+String.join(", ",winCars));

Choose a reason for hiding this comment

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

ctrl + alt + L 을 통해서 라인정렬을 해 줄 수 있습니다 !

Copy link
Author

Choose a reason for hiding this comment

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

라인정렬 완료했습니다!

Comment on lines +12 to +16
if (name.length() > 5)
{
throw new IllegalArgumentException("5자 이하만");

}

Choose a reason for hiding this comment

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

이 검증 로직도 메서드로 빼줄 수 있을 것 같아요!

Copy link
Author

Choose a reason for hiding this comment

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

메서드로 뺐습니다!

@audgk54587 audgk54587 closed this Apr 6, 2025
@audgk54587 audgk54587 reopened this Apr 6, 2025
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