Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

ZZZ #14

wants to merge 1 commit into from

Conversation

jun673012
Copy link

No description provided.

Copy link

@nuyh99 nuyh99 left a 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);
Copy link

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();
Copy link

Choose a reason for hiding this comment

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

자바 컨벤션을 따르면

Suggested change
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)
Copy link

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)
Copy link

Choose a reason for hiding this comment

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

여기 까지 도달하는 조건은 위의 모든 조건이 false라는 전제 조건을 가지고 있어요.
그렇다면 select_Cash == 6 이라는 조건을 수정하려면 위의 모든 코드들을 살펴봐야 합니다.
빠른 리턴을 해서 줄인다면 더 좋을 것 같아요!




}
Copy link

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) {
Copy link

@huhdy32 huhdy32 Nov 26, 2023

Choose a reason for hiding this comment

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

수정이 필요해 보입니다!
selectNumber != 1 && selectNumber != 2 로 바꾸는것이 좋아보이네요 :)

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.

3 participants