-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZZZ #14
base: main
Are you sure you want to change the base?
ZZZ #14
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very goooooood!!!
final String USER_INPUT = "사용자 입력 > "; | ||
final String LINE = "----------------------------"; | ||
|
||
Scanner sc = new Scanner(System.in); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
축약형 안 쓰면 좋을 것 같아요!
System.out.println(); | ||
System.out.print("사용자 입력 > "); | ||
|
||
int select_Payment_Method = sc.nextInt(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
자바 컨벤션을 따르면
int select_Payment_Method = sc.nextInt(); | |
int paymentMethod = scanner.nextInt(); |
처럼 될 것 같아요!
int select_Payment_Method = sc.nextInt(); | ||
System.out.println(); | ||
System.out.println("----------------------------"); | ||
if(select_Payment_Method != 1 || select_Payment_Method != 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 코드를 처음 본 사람은 1이나 2가 무엇을 의미하는 지 바로 알아차리기 어려울 것 같은데요!
매직넘버를 상수화 해도 좋을 것 같네요!
return 1000; | ||
else if (select_Cash == 5) | ||
return 500; | ||
else if (select_Cash == 6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기 까지 도달하는 조건은 위의 모든 조건이 false라는 전제 조건을 가지고 있어요.
그렇다면 select_Cash == 6
이라는 조건을 수정하려면 위의 모든 코드들을 살펴봐야 합니다.
빠른 리턴을 해서 줄인다면 더 좋을 것 같아요!
|
||
|
||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
모든 파일의 끝에는 개행을 추가하는 것이 컨벤션입니다!
int selectDrinkTemperature() { | ||
int selectNumber = userSelectNumber(); | ||
while(true) { | ||
if (selectNumber != 1 || selectNumber != 2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수정이 필요해 보입니다!
selectNumber != 1 && selectNumber != 2 로 바꾸는것이 좋아보이네요 :)
No description provided.