-
Notifications
You must be signed in to change notification settings - Fork 5
[정홍섭]과제 제출합니다 #5
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
base: hongsub
Are you sure you want to change the base?
Conversation
이밤돌학생의 원서 재제출, 원서 조회, 불합 여부, 학생이 자신의 원서 조회하는 기능을 구현했다.`
|
제목 형식 "[이름] 과제 제출합니다"로 통일해주세요 |
🙌 @junghongseop 님 안녕하세요밤돌이로 백엔드 개발 팀입니다. 먼저, 과제 전형 기간 동안 수고하셨습니다! 과제를 준비하면서 얻어가셨길 바랐던 것은 인데요, 다들 어느정도 얻어가신 것 같아 뿌듯하네요. 과제 전형 점수 안내드립니다.
총점 93점으로, 1차 과제 전형에서 합격하셨습니다. 감사합니다. |
gimhanul
left a comment
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.
수고하셨습니다~
리뷰 참고해서 반영하셔도 되고, 그대로 머지하셔도 됩니다!
| this.attendance = attendance; | ||
| this.plusScore = plusScore; | ||
| this.total = score + attendance + plusScore ; //합불을 구하는 기준 | ||
| // System.out.println(total); |
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(total); |
사용하지 않아서 주석처리 해 놓은 것들은 삭제해주는 게 좋아요
| public void setPass(boolean pass){ | ||
| this.pass = pass; | ||
| } |
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.
이런 메서드는 setter를 사용하기보다는
pass()나 failed() 메서드로 만들어서 사용하는 게 더 읽기 쉬워질 것 같아요
덧붙이면 setter를 지양해야 하기도 하구요.
관련된 내용은 검색해서 찾아보시면 좋을 것 같아요!
| if (document.total < total){ | ||
| return 1; //document.total < total은 현재 객체인 total값이 더 크다는 것을 의미 | ||
| } //따라서 현재객체가 document 객체보다 우선순위가 높다는 것을 나타내기 위해 1을 반환 | ||
| else if (document.total > total){ | ||
| return -1; //document.total > total은 현재 객체의 total 값이 더 작다는 것을 의미 | ||
| } // 현재 객체가 document 객체보다 우선순위가 낮다는 것을 나타내기 위해 -1을 반환 | ||
| return 0; //두 조건에 해당하지 않을 경우, total 값이 동일하다는 것을 의미, 두 객체의 우선순위가 같다는 것을 나타내기 위해 0을 반환 |
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.
| if (document.total < total){ | |
| return 1; //document.total < total은 현재 객체인 total값이 더 크다는 것을 의미 | |
| } //따라서 현재객체가 document 객체보다 우선순위가 높다는 것을 나타내기 위해 1을 반환 | |
| else if (document.total > total){ | |
| return -1; //document.total > total은 현재 객체의 total 값이 더 작다는 것을 의미 | |
| } // 현재 객체가 document 객체보다 우선순위가 낮다는 것을 나타내기 위해 -1을 반환 | |
| return 0; //두 조건에 해당하지 않을 경우, total 값이 동일하다는 것을 의미, 두 객체의 우선순위가 같다는 것을 나타내기 위해 0을 반환 | |
| return total - document.total; |
이렇게 짧게 줄일 수 있어요.
그리고 줄여서 짧아진 메서드는 람다식으로도 표현할 수 있을 것 같네요
관련된 내용은 람다 키워드로 검색해보세용
| // TODO-1 이밤돌 학생 원서 | ||
| // 이밤돌 학생이 부산소프트웨어마이스터고등학교에 낼 원서를 작성합니다. | ||
|
|
||
| bamdol.writeDocument("010-1234-5678", 100, 50, 5); // score 만점: 100, attendance 만점: 50, plusScore 만점: 5 |
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.
만점이 몇 점인지 나타내는 주석은 여기보다는 Document 클래스로 옮기는 게 좋겠네요
| Student bamdol = new Student("이밤돌", "밤돌중학교"); | ||
| // 곰돌중학교를 다니고 있는 금곰돌 학생을 생성합니다. | ||
|
|
||
| Student gomdol = new Student("금곰돌", "곰돌중학교"); |
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.
중학교를 생성할 때 물론 쓸모는 없겠지만 만들어둔 school 클래스를 넣는 것도 좋았을 것 같아요.
필요하진 않아도 "학교"라는 의미가 더 잘 드러나니까요
| private String name; | ||
| private String middleSchool; | ||
| private Document document = new Document(); | ||
| private int count = 1; |
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.
이런 변수는 그냥 count로 두기보다는
제출횟수 같은 네이밍을 사용하는 게 의미가 더 잘 드러나요
|
|
||
| /*학생 원서 재체출*/ | ||
| public void sentDocument(School school){ | ||
| if(count > 0){ //count > 0은 학생이 원서를 아직 제출하지 않았을 경우를 나타냄. 즉, count변수가 1보다 큰 경우 |
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.
count를 사용하는 것 보다 boolean을 사용하는 게 더 좋겠네요
어차피 제출은 한 번만 할 수 있으니 제출함/안함 두 개의 상태만 있으니까요
| public void getDocument(Document document){ | ||
| documents.add(document); |
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. 진행 중 느낀점
과제를 진행하며 한 고민들 *
발생한 이슈와 해결 방법
질문