{"action":"created","comment":{"url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/pulls/comments/115830760","pull_request_review_id":37404421,"id":115830760,"diff_hunk":"@@ -0,0 +1,31 @@\n+// Copyright 2017 Bakalin Andrey\n+\n+#include \"include/mortgage_calculator.h\"\n+#include <stdexcept>\n+#include <cmath>\n+\n+calculator_result MortgageCalculator::mortgage_calculator(double amount,\n+    int period, double interest) {\n+    if (amount <= 0) {\n+        throw std::invalid_argument(\"Amount was entered incorrectly\");\n+    }\n+    if (period <= 0 || period > 600) {\n+        throw std::invalid_argument(\"Period was entered incorrectly\");\n+    }\n+    if (interest <= 0 || interest >= 100) {\n+        throw std::invalid_argument(\"Interest was entered incorrectly\");\n+    }\n+    if ((1 - pow(1 + interest, -period)) == 0) {\n+        throw std::invalid_argument(\"Interest can't be so low\");\n+    }\n+\n+    calculator_result result;\n+    double month_interest = interest / (100 * 12);\n+\n+    result.monthly_payment = amount * month_interest /\n+        (1 - pow(1 + month_interest, -period));\n+    result.total_payout = (result.monthly_payment * period);","path":"modules/mortgage-calculator/src/mortgage_calculator.cpp","position":27,"original_position":27,"commit_id":"0e5dbdffeea623cf16404a2e92bfc9dc84b517a3","original_commit_id":"0e5dbdffeea623cf16404a2e92bfc9dc84b517a3","user":{"login":"DmitrichevNick","id":27294351,"avatar_url":"https://avatars1.githubusercontent.com/u/27294351?v=3","gravatar_id":"","url":"https://api.github.com/users/DmitrichevNick","html_url":"https://github.com/DmitrichevNick","followers_url":"https://api.github.com/users/DmitrichevNick/followers","following_url":"https://api.github.com/users/DmitrichevNick/following{/other_user}","gists_url":"https://api.github.com/users/DmitrichevNick/gists{/gist_id}","starred_url":"https://api.github.com/users/DmitrichevNick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DmitrichevNick/subscriptions","organizations_url":"https://api.github.com/users/DmitrichevNick/orgs","repos_url":"https://api.github.com/users/DmitrichevNick/repos","events_url":"https://api.github.com/users/DmitrichevNick/events{/privacy}","received_events_url":"https://api.github.com/users/DmitrichevNick/received_events","type":"User","site_admin":false},"body":"А скобки зачем?","created_at":"2017-05-10T19:27:40Z","updated_at":"2017-05-10T19:28:47Z","html_url":"https://github.com/UNN-VMK-Software/devtools-course-practice/pull/123#discussion_r115830760","pull_request_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/pulls/123","_links":{"self":{"href":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/pulls/comments/115830760"},"html":{"href":"https://github.com/UNN-VMK-Software/devtools-course-practice/pull/123#discussion_r115830760"},"pull_request":{"href":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/pulls/123"}}},"pull_request":{"url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/pulls/123","id":119806863,"html_url":"https://github.com/UNN-VMK-Software/devtools-course-practice/pull/123","diff_url":"https://github.com/UNN-VMK-Software/devtools-course-practice/pull/123.diff","patch_url":"https://github.com/UNN-VMK-Software/devtools-course-practice/pull/123.patch","issue_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/issues/123","number":123,"state":"open","locked":false,"title":"Бакалин - Лабораторная работа #2","user":{"login":"AndrewBakalin","id":27020952,"avatar_url":"https://avatars1.githubusercontent.com/u/27020952?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewBakalin","html_url":"https://github.com/AndrewBakalin","followers_url":"https://api.github.com/users/AndrewBakalin/followers","following_url":"https://api.github.com/users/AndrewBakalin/following{/other_user}","gists_url":"https://api.github.com/users/AndrewBakalin/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewBakalin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewBakalin/subscriptions","organizations_url":"https://api.github.com/users/AndrewBakalin/orgs","repos_url":"https://api.github.com/users/AndrewBakalin/repos","events_url":"https://api.github.com/users/AndrewBakalin/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewBakalin/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-05-10T05:47:04Z","updated_at":"2017-05-10T19:28:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f1fa7addd97ae946d048894b48e0982f1d96b16","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/pulls/123/commits","review_comments_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/pulls/123/comments","review_comment_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/issues/123/comments","statuses_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/statuses/0e5dbdffeea623cf16404a2e92bfc9dc84b517a3","head":{"label":"AndrewBakalin:Bakalin-Andrey-lab2","ref":"Bakalin-Andrey-lab2","sha":"0e5dbdffeea623cf16404a2e92bfc9dc84b517a3","user":{"login":"AndrewBakalin","id":27020952,"avatar_url":"https://avatars1.githubusercontent.com/u/27020952?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewBakalin","html_url":"https://github.com/AndrewBakalin","followers_url":"https://api.github.com/users/AndrewBakalin/followers","following_url":"https://api.github.com/users/AndrewBakalin/following{/other_user}","gists_url":"https://api.github.com/users/AndrewBakalin/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewBakalin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewBakalin/subscriptions","organizations_url":"https://api.github.com/users/AndrewBakalin/orgs","repos_url":"https://api.github.com/users/AndrewBakalin/repos","events_url":"https://api.github.com/users/AndrewBakalin/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewBakalin/received_events","type":"User","site_admin":false},"repo":{"id":90822719,"name":"devtools-course-practice","full_name":"AndrewBakalin/devtools-course-practice","owner":{"login":"AndrewBakalin","id":27020952,"avatar_url":"https://avatars1.githubusercontent.com/u/27020952?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewBakalin","html_url":"https://github.com/AndrewBakalin","followers_url":"https://api.github.com/users/AndrewBakalin/followers","following_url":"https://api.github.com/users/AndrewBakalin/following{/other_user}","gists_url":"https://api.github.com/users/AndrewBakalin/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewBakalin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewBakalin/subscriptions","organizations_url":"https://api.github.com/users/AndrewBakalin/orgs","repos_url":"https://api.github.com/users/AndrewBakalin/repos","events_url":"https://api.github.com/users/AndrewBakalin/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewBakalin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AndrewBakalin/devtools-course-practice","description":null,"fork":true,"url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice","forks_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/forks","keys_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/teams","hooks_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/hooks","issue_events_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/issues/events{/number}","events_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/events","assignees_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/assignees{/user}","branches_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/branches{/branch}","tags_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/tags","blobs_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/git/refs{/sha}","trees_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/statuses/{sha}","languages_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/languages","stargazers_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/stargazers","contributors_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/contributors","subscribers_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/subscribers","subscription_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/subscription","commits_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/commits{/sha}","git_commits_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/git/commits{/sha}","comments_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/comments{/number}","issue_comment_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/issues/comments{/number}","contents_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/contents/{+path}","compare_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/merges","archive_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/downloads","issues_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/issues{/number}","pulls_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/pulls{/number}","milestones_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/milestones{/number}","notifications_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/labels{/name}","releases_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/releases{/id}","deployments_url":"https://api.github.com/repos/AndrewBakalin/devtools-course-practice/deployments","created_at":"2017-05-10T05:01:42Z","updated_at":"2017-05-10T05:01:44Z","pushed_at":"2017-05-10T05:40:04Z","git_url":"git://github.com/AndrewBakalin/devtools-course-practice.git","ssh_url":"git@github.com:AndrewBakalin/devtools-course-practice.git","clone_url":"https://github.com/AndrewBakalin/devtools-course-practice.git","svn_url":"https://github.com/AndrewBakalin/devtools-course-practice","homepage":null,"size":688,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"UNN-VMK-Software:master","ref":"master","sha":"0f3986e4dcf69bef2fa75fff38bd13b671010f9a","user":{"login":"UNN-VMK-Software","id":5463209,"avatar_url":"https://avatars1.githubusercontent.com/u/5463209?v=3","gravatar_id":"","url":"https://api.github.com/users/UNN-VMK-Software","html_url":"https://github.com/UNN-VMK-Software","followers_url":"https://api.github.com/users/UNN-VMK-Software/followers","following_url":"https://api.github.com/users/UNN-VMK-Software/following{/other_user}","gists_url":"https://api.github.com/users/UNN-VMK-Software/gists{/gist_id}","starred_url":"https://api.github.com/users/UNN-VMK-Software/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UNN-VMK-Software/subscriptions","organizations_url":"https://api.github.com/users/UNN-VMK-Software/orgs","repos_url":"https://api.github.com/users/UNN-VMK-Software/repos","events_url":"https://api.github.com/users/UNN-VMK-Software/events{/privacy}","received_events_url":"https://api.github.com/users/UNN-VMK-Software/received_events","type":"Organization","site_admin":false},"repo":{"id":86228350,"name":"devtools-course-practice","full_name":"UNN-VMK-Software/devtools-course-practice","owner":{"login":"UNN-VMK-Software","id":5463209,"avatar_url":"https://avatars1.githubusercontent.com/u/5463209?v=3","gravatar_id":"","url":"https://api.github.com/users/UNN-VMK-Software","html_url":"https://github.com/UNN-VMK-Software","followers_url":"https://api.github.com/users/UNN-VMK-Software/followers","following_url":"https://api.github.com/users/UNN-VMK-Software/following{/other_user}","gists_url":"https://api.github.com/users/UNN-VMK-Software/gists{/gist_id}","starred_url":"https://api.github.com/users/UNN-VMK-Software/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UNN-VMK-Software/subscriptions","organizations_url":"https://api.github.com/users/UNN-VMK-Software/orgs","repos_url":"https://api.github.com/users/UNN-VMK-Software/repos","events_url":"https://api.github.com/users/UNN-VMK-Software/events{/privacy}","received_events_url":"https://api.github.com/users/UNN-VMK-Software/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UNN-VMK-Software/devtools-course-practice","description":null,"fork":false,"url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice","forks_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/forks","keys_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/teams","hooks_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/hooks","issue_events_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/issues/events{/number}","events_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/events","assignees_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/assignees{/user}","branches_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/branches{/branch}","tags_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/tags","blobs_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/git/refs{/sha}","trees_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/statuses/{sha}","languages_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/languages","stargazers_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/stargazers","contributors_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/contributors","subscribers_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/subscribers","subscription_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/subscription","commits_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/commits{/sha}","git_commits_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/git/commits{/sha}","comments_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/comments{/number}","issue_comment_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/issues/comments{/number}","contents_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/contents/{+path}","compare_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/merges","archive_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/downloads","issues_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/issues{/number}","pulls_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/pulls{/number}","milestones_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/milestones{/number}","notifications_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/labels{/name}","releases_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/releases{/id}","deployments_url":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/deployments","created_at":"2017-03-26T11:46:27Z","updated_at":"2017-03-26T11:46:47Z","pushed_at":"2017-05-10T19:22:16Z","git_url":"git://github.com/UNN-VMK-Software/devtools-course-practice.git","ssh_url":"git@github.com:UNN-VMK-Software/devtools-course-practice.git","clone_url":"https://github.com/UNN-VMK-Software/devtools-course-practice.git","svn_url":"https://github.com/UNN-VMK-Software/devtools-course-practice","homepage":null,"size":826,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":26,"forks":46,"open_issues":26,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/pulls/123"},"html":{"href":"https://github.com/UNN-VMK-Software/devtools-course-practice/pull/123"},"issue":{"href":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/issues/123"},"comments":{"href":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/issues/123/comments"},"review_comments":{"href":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/pulls/123/comments"},"review_comment":{"href":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/pulls/123/commits"},"statuses":{"href":"https://api.github.com/repos/UNN-VMK-Software/devtools-course-practice/statuses/0e5dbdffeea623cf16404a2e92bfc9dc84b517a3"}}}}
{"actor":{"display_login":"DmitrichevNick"}}