{"action":"created","comment":{"url":"https://api.github.com/repos/code-squad/javascript-grade/pulls/comments/218641650","pull_request_review_id":156625578,"id":218641650,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODY0MTY1MA==","diff_hunk":"@@ -0,0 +1,91 @@\n+var data = [{\n+        'name': '데이터베이스',\n+        'grade': 'A',\n+        'credit': 3,\n+        'major': false\n+    },\n+    {\n+        'name': '교양영어',\n+        'grade': 'B+',\n+        'credit': 2,\n+        'major': true\n+    },\n+    {\n+        'name': '철학',\n+        'grade': 'B+',\n+        'credit': 1,\n+        'major': false\n+    },\n+];\n+\n+function calculateCredits(data) {\n+    let grossCredits = 0;\n+    let grossMajorCredits = 0;\n+    for (let key in data) {\n+        grossCredits += data[key].credit;\n+        if (data[key].major) {\n+            grossMajorCredits += data[key].credit;\n+        }\n+    }\n+    return [grossCredits, grossMajorCredits];\n+}\n+\n+function calculatePoints(data) {\n+    let grossPoints = 0;\n+    let grossMajorPoints = 0;\n+    tableFourPointZero = {\n+        'A+': 4.3,\n+        'A': 4.0,\n+        'A-': 3.7,\n+        'B+': 3.3,\n+        'B': 3.0,\n+        'B-': 2.7,\n+        'C+': 2.5,\n+        'C': 2.0,\n+        'C-': 1.7,\n+        'D+': 1.5,\n+        'D': 1.0,\n+        'D-': 0.7,\n+        'F': 0,\n+    }\n+\n+    for (let i in data) {\n+        for (let key in data[i]) {\n+            if (key === 'grade') {\n+                grossPoints += (data[i].credit * tableFourPointZero[data[i][key]]);\n+                if (data[i].major) {\n+                grossMajorPoints += data[i].credit * tableFourPointZero[data[i][key]];\n+                }\n+            }\n+\n+        }\n+    }\n+    return [grossPoints, grossMajorPoints];\n+}\n+\n+\n+function gpaCalculator(data){\n+let result = '';\n+let credits = calculateCredits(data);\n+let grossCredits = credits[0];\n+let grossMajorCredits = credits[1];\n+\n+let points = calculatePoints(data);\n+let grossPoints = points[0];\n+let grossMajorPoints = points[1];\n+\n+let gpaFourPointThree = (grossPoints / grossCredits).toFixed(2);","path":"L2_step1_gpaCal.js","position":77,"original_position":77,"commit_id":"f734b27459fe5601672ad6bdf03d9b3c8dacb0d4","original_commit_id":"f734b27459fe5601672ad6bdf03d9b3c8dacb0d4","user":{"login":"developersoom","id":40848630,"node_id":"MDQ6VXNlcjQwODQ4NjMw","avatar_url":"https://avatars2.githubusercontent.com/u/40848630?v=4","gravatar_id":"","url":"https://api.github.com/users/developersoom","html_url":"https://github.com/developersoom","followers_url":"https://api.github.com/users/developersoom/followers","following_url":"https://api.github.com/users/developersoom/following{/other_user}","gists_url":"https://api.github.com/users/developersoom/gists{/gist_id}","starred_url":"https://api.github.com/users/developersoom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/developersoom/subscriptions","organizations_url":"https://api.github.com/users/developersoom/orgs","repos_url":"https://api.github.com/users/developersoom/repos","events_url":"https://api.github.com/users/developersoom/events{/privacy}","received_events_url":"https://api.github.com/users/developersoom/received_events","type":"User","site_admin":false},"body":"고민을 좀 더 해보겠습니다요! ","created_at":"2018-09-19T01:11:39Z","updated_at":"2018-09-19T01:11:39Z","html_url":"https://github.com/code-squad/javascript-grade/pull/27#discussion_r218641650","pull_request_url":"https://api.github.com/repos/code-squad/javascript-grade/pulls/27","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/code-squad/javascript-grade/pulls/comments/218641650"},"html":{"href":"https://github.com/code-squad/javascript-grade/pull/27#discussion_r218641650"},"pull_request":{"href":"https://api.github.com/repos/code-squad/javascript-grade/pulls/27"}},"in_reply_to_id":218446903},"pull_request":{"url":"https://api.github.com/repos/code-squad/javascript-grade/pulls/27","id":215934464,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1OTM0NDY0","html_url":"https://github.com/code-squad/javascript-grade/pull/27","diff_url":"https://github.com/code-squad/javascript-grade/pull/27.diff","patch_url":"https://github.com/code-squad/javascript-grade/pull/27.patch","issue_url":"https://api.github.com/repos/code-squad/javascript-grade/issues/27","number":27,"state":"open","locked":false,"title":"[숨] 학점계산기_step 1_피드백 반영","user":{"login":"developersoom","id":40848630,"node_id":"MDQ6VXNlcjQwODQ4NjMw","avatar_url":"https://avatars2.githubusercontent.com/u/40848630?v=4","gravatar_id":"","url":"https://api.github.com/users/developersoom","html_url":"https://github.com/developersoom","followers_url":"https://api.github.com/users/developersoom/followers","following_url":"https://api.github.com/users/developersoom/following{/other_user}","gists_url":"https://api.github.com/users/developersoom/gists{/gist_id}","starred_url":"https://api.github.com/users/developersoom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/developersoom/subscriptions","organizations_url":"https://api.github.com/users/developersoom/orgs","repos_url":"https://api.github.com/users/developersoom/repos","events_url":"https://api.github.com/users/developersoom/events{/privacy}","received_events_url":"https://api.github.com/users/developersoom/received_events","type":"User","site_admin":false},"body":"Lecture 2 step 1 학점 계산기 구현하였습니다.\r\n코드 리뷰 부탁드리겠습니다~!! ","created_at":"2018-09-17T10:26:08Z","updated_at":"2018-09-19T01:11:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"225caa88d196dcd6dd259f971daf7f2788daa31a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/code-squad/javascript-grade/pulls/27/commits","review_comments_url":"https://api.github.com/repos/code-squad/javascript-grade/pulls/27/comments","review_comment_url":"https://api.github.com/repos/code-squad/javascript-grade/pulls/comments{/number}","comments_url":"https://api.github.com/repos/code-squad/javascript-grade/issues/27/comments","statuses_url":"https://api.github.com/repos/code-squad/javascript-grade/statuses/f734b27459fe5601672ad6bdf03d9b3c8dacb0d4","head":{"label":"developersoom:step1","ref":"step1","sha":"f734b27459fe5601672ad6bdf03d9b3c8dacb0d4","user":{"login":"developersoom","id":40848630,"node_id":"MDQ6VXNlcjQwODQ4NjMw","avatar_url":"https://avatars2.githubusercontent.com/u/40848630?v=4","gravatar_id":"","url":"https://api.github.com/users/developersoom","html_url":"https://github.com/developersoom","followers_url":"https://api.github.com/users/developersoom/followers","following_url":"https://api.github.com/users/developersoom/following{/other_user}","gists_url":"https://api.github.com/users/developersoom/gists{/gist_id}","starred_url":"https://api.github.com/users/developersoom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/developersoom/subscriptions","organizations_url":"https://api.github.com/users/developersoom/orgs","repos_url":"https://api.github.com/users/developersoom/repos","events_url":"https://api.github.com/users/developersoom/events{/privacy}","received_events_url":"https://api.github.com/users/developersoom/received_events","type":"User","site_admin":false},"repo":{"id":149105729,"node_id":"MDEwOlJlcG9zaXRvcnkxNDkxMDU3Mjk=","name":"javascript-grade","full_name":"developersoom/javascript-grade","private":false,"owner":{"login":"developersoom","id":40848630,"node_id":"MDQ6VXNlcjQwODQ4NjMw","avatar_url":"https://avatars2.githubusercontent.com/u/40848630?v=4","gravatar_id":"","url":"https://api.github.com/users/developersoom","html_url":"https://github.com/developersoom","followers_url":"https://api.github.com/users/developersoom/followers","following_url":"https://api.github.com/users/developersoom/following{/other_user}","gists_url":"https://api.github.com/users/developersoom/gists{/gist_id}","starred_url":"https://api.github.com/users/developersoom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/developersoom/subscriptions","organizations_url":"https://api.github.com/users/developersoom/orgs","repos_url":"https://api.github.com/users/developersoom/repos","events_url":"https://api.github.com/users/developersoom/events{/privacy}","received_events_url":"https://api.github.com/users/developersoom/received_events","type":"User","site_admin":false},"html_url":"https://github.com/developersoom/javascript-grade","description":"레벨2","fork":true,"url":"https://api.github.com/repos/developersoom/javascript-grade","forks_url":"https://api.github.com/repos/developersoom/javascript-grade/forks","keys_url":"https://api.github.com/repos/developersoom/javascript-grade/keys{/key_id}","collaborators_url":"https://api.github.com/repos/developersoom/javascript-grade/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/developersoom/javascript-grade/teams","hooks_url":"https://api.github.com/repos/developersoom/javascript-grade/hooks","issue_events_url":"https://api.github.com/repos/developersoom/javascript-grade/issues/events{/number}","events_url":"https://api.github.com/repos/developersoom/javascript-grade/events","assignees_url":"https://api.github.com/repos/developersoom/javascript-grade/assignees{/user}","branches_url":"https://api.github.com/repos/developersoom/javascript-grade/branches{/branch}","tags_url":"https://api.github.com/repos/developersoom/javascript-grade/tags","blobs_url":"https://api.github.com/repos/developersoom/javascript-grade/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/developersoom/javascript-grade/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/developersoom/javascript-grade/git/refs{/sha}","trees_url":"https://api.github.com/repos/developersoom/javascript-grade/git/trees{/sha}","statuses_url":"https://api.github.com/repos/developersoom/javascript-grade/statuses/{sha}","languages_url":"https://api.github.com/repos/developersoom/javascript-grade/languages","stargazers_url":"https://api.github.com/repos/developersoom/javascript-grade/stargazers","contributors_url":"https://api.github.com/repos/developersoom/javascript-grade/contributors","subscribers_url":"https://api.github.com/repos/developersoom/javascript-grade/subscribers","subscription_url":"https://api.github.com/repos/developersoom/javascript-grade/subscription","commits_url":"https://api.github.com/repos/developersoom/javascript-grade/commits{/sha}","git_commits_url":"https://api.github.com/repos/developersoom/javascript-grade/git/commits{/sha}","comments_url":"https://api.github.com/repos/developersoom/javascript-grade/comments{/number}","issue_comment_url":"https://api.github.com/repos/developersoom/javascript-grade/issues/comments{/number}","contents_url":"https://api.github.com/repos/developersoom/javascript-grade/contents/{+path}","compare_url":"https://api.github.com/repos/developersoom/javascript-grade/compare/{base}...{head}","merges_url":"https://api.github.com/repos/developersoom/javascript-grade/merges","archive_url":"https://api.github.com/repos/developersoom/javascript-grade/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/developersoom/javascript-grade/downloads","issues_url":"https://api.github.com/repos/developersoom/javascript-grade/issues{/number}","pulls_url":"https://api.github.com/repos/developersoom/javascript-grade/pulls{/number}","milestones_url":"https://api.github.com/repos/developersoom/javascript-grade/milestones{/number}","notifications_url":"https://api.github.com/repos/developersoom/javascript-grade/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/developersoom/javascript-grade/labels{/name}","releases_url":"https://api.github.com/repos/developersoom/javascript-grade/releases{/id}","deployments_url":"https://api.github.com/repos/developersoom/javascript-grade/deployments","created_at":"2018-09-17T10:03:38Z","updated_at":"2018-09-17T10:03:40Z","pushed_at":"2018-09-18T08:39:51Z","git_url":"git://github.com/developersoom/javascript-grade.git","ssh_url":"git@github.com:developersoom/javascript-grade.git","clone_url":"https://github.com/developersoom/javascript-grade.git","svn_url":"https://github.com/developersoom/javascript-grade","homepage":null,"size":4123,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"code-squad:developersoom","ref":"developersoom","sha":"27fd3882aa00ca6ef22d80b33522b8f68be290f9","user":{"login":"code-squad","id":22832280,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyODMyMjgw","avatar_url":"https://avatars2.githubusercontent.com/u/22832280?v=4","gravatar_id":"","url":"https://api.github.com/users/code-squad","html_url":"https://github.com/code-squad","followers_url":"https://api.github.com/users/code-squad/followers","following_url":"https://api.github.com/users/code-squad/following{/other_user}","gists_url":"https://api.github.com/users/code-squad/gists{/gist_id}","starred_url":"https://api.github.com/users/code-squad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-squad/subscriptions","organizations_url":"https://api.github.com/users/code-squad/orgs","repos_url":"https://api.github.com/users/code-squad/repos","events_url":"https://api.github.com/users/code-squad/events{/privacy}","received_events_url":"https://api.github.com/users/code-squad/received_events","type":"Organization","site_admin":false},"repo":{"id":107010068,"node_id":"MDEwOlJlcG9zaXRvcnkxMDcwMTAwNjg=","name":"javascript-grade","full_name":"code-squad/javascript-grade","private":false,"owner":{"login":"code-squad","id":22832280,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyODMyMjgw","avatar_url":"https://avatars2.githubusercontent.com/u/22832280?v=4","gravatar_id":"","url":"https://api.github.com/users/code-squad","html_url":"https://github.com/code-squad","followers_url":"https://api.github.com/users/code-squad/followers","following_url":"https://api.github.com/users/code-squad/following{/other_user}","gists_url":"https://api.github.com/users/code-squad/gists{/gist_id}","starred_url":"https://api.github.com/users/code-squad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-squad/subscriptions","organizations_url":"https://api.github.com/users/code-squad/orgs","repos_url":"https://api.github.com/users/code-squad/repos","events_url":"https://api.github.com/users/code-squad/events{/privacy}","received_events_url":"https://api.github.com/users/code-squad/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/code-squad/javascript-grade","description":"레벨2","fork":false,"url":"https://api.github.com/repos/code-squad/javascript-grade","forks_url":"https://api.github.com/repos/code-squad/javascript-grade/forks","keys_url":"https://api.github.com/repos/code-squad/javascript-grade/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-squad/javascript-grade/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-squad/javascript-grade/teams","hooks_url":"https://api.github.com/repos/code-squad/javascript-grade/hooks","issue_events_url":"https://api.github.com/repos/code-squad/javascript-grade/issues/events{/number}","events_url":"https://api.github.com/repos/code-squad/javascript-grade/events","assignees_url":"https://api.github.com/repos/code-squad/javascript-grade/assignees{/user}","branches_url":"https://api.github.com/repos/code-squad/javascript-grade/branches{/branch}","tags_url":"https://api.github.com/repos/code-squad/javascript-grade/tags","blobs_url":"https://api.github.com/repos/code-squad/javascript-grade/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-squad/javascript-grade/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-squad/javascript-grade/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-squad/javascript-grade/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-squad/javascript-grade/statuses/{sha}","languages_url":"https://api.github.com/repos/code-squad/javascript-grade/languages","stargazers_url":"https://api.github.com/repos/code-squad/javascript-grade/stargazers","contributors_url":"https://api.github.com/repos/code-squad/javascript-grade/contributors","subscribers_url":"https://api.github.com/repos/code-squad/javascript-grade/subscribers","subscription_url":"https://api.github.com/repos/code-squad/javascript-grade/subscription","commits_url":"https://api.github.com/repos/code-squad/javascript-grade/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-squad/javascript-grade/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-squad/javascript-grade/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-squad/javascript-grade/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-squad/javascript-grade/contents/{+path}","compare_url":"https://api.github.com/repos/code-squad/javascript-grade/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-squad/javascript-grade/merges","archive_url":"https://api.github.com/repos/code-squad/javascript-grade/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-squad/javascript-grade/downloads","issues_url":"https://api.github.com/repos/code-squad/javascript-grade/issues{/number}","pulls_url":"https://api.github.com/repos/code-squad/javascript-grade/pulls{/number}","milestones_url":"https://api.github.com/repos/code-squad/javascript-grade/milestones{/number}","notifications_url":"https://api.github.com/repos/code-squad/javascript-grade/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-squad/javascript-grade/labels{/name}","releases_url":"https://api.github.com/repos/code-squad/javascript-grade/releases{/id}","deployments_url":"https://api.github.com/repos/code-squad/javascript-grade/deployments","created_at":"2017-10-15T12:27:20Z","updated_at":"2018-09-18T00:05:53Z","pushed_at":"2018-09-18T16:29:11Z","git_url":"git://github.com/code-squad/javascript-grade.git","ssh_url":"git@github.com:code-squad/javascript-grade.git","clone_url":"https://github.com/code-squad/javascript-grade.git","svn_url":"https://github.com/code-squad/javascript-grade","homepage":null,"size":4121,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":7,"license":null,"forks":19,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/code-squad/javascript-grade/pulls/27"},"html":{"href":"https://github.com/code-squad/javascript-grade/pull/27"},"issue":{"href":"https://api.github.com/repos/code-squad/javascript-grade/issues/27"},"comments":{"href":"https://api.github.com/repos/code-squad/javascript-grade/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/code-squad/javascript-grade/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/code-squad/javascript-grade/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/code-squad/javascript-grade/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/code-squad/javascript-grade/statuses/f734b27459fe5601672ad6bdf03d9b3c8dacb0d4"}},"author_association":"NONE"}}
{"actor":{"display_login":"developersoom"}}