{"action":"created","comment":{"url":"https://api.github.com/repos/balodza/taras_java_learning/pulls/comments/225919723","pull_request_review_id":165619215,"id":225919723,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNTkxOTcyMw==","diff_hunk":"@@ -1,15 +1,143 @@\n package com.katsora.statements.calculator;\n \n+\n+/*Написати програму-калькулятор яка рахує:\n+- суму 4х заданих цифр\n+- порахувати добуток всіх 4х цифр\n+- порахувати середнє арифметичне цих 4х цифр\n+- найти найбільше з 4х чисел\n+- найти найменше з 4х чисел\n+- порахувати кількість чисел більше 0\n+- порахувати кількість чисел менше 0\n+- порахувати середнє арифметичне чисел, більших чим 10*/\n+\n+\n+import java.util.Scanner;\n+\n public class Calculator {\n-    public static int sum(int a, int b) {\n-        return a + b;\n+    public static void main(String[] args) {\n+        System.out.println(\"Введіть числа:\");\n+        Scanner in = new Scanner(System.in);\n+        int res1 = in.nextInt();\n+        int res2 = in.nextInt();\n+        int res3 = in.nextInt();\n+        int res4 = in.nextInt();\n+        final int sum = sum(res1, res2, res3, res4);\n+        final int multiply = multiply(res1, res2, res3, res4);\n+        final int nohadzenyaNaibilshogoChusla = nohadzenyaNaibilshogoChusla(res1, res2, res3, res4);\n+        final int nohadzenyaNaimenshogoChusla = nohadzenyaNaimenshogoChusla(res1, res2, res3, res4);\n+        final int seredneArufm = seredneArufm(res1, res2, res3, res4);\n+        final int nohadzenyaChuselMenshuxNylya = nohadzenyaChuselMenshuxNylya(res1, res2, res3, res4);\n+        final int nohadzenyaChuselBilshuxNylya = nohadzenyaChuselBilshuxNylya(res1, res2, res3, res4);\n+        final int nahodzennyaSerednogoArufCHuselBilshuxDecatu = nahodzennyaSerednogoArufCHuselBilshuxDecatu(res1, res2, res3, res4);\n+\n+        System.out.println(\"Result of sum: \" + sum);\n+        System.out.println(\"Result of multiply: \" + multiply);\n+        System.out.println(\"The biggest number is: \" + nohadzenyaNaibilshogoChusla);\n+        System.out.println(\"The smallest number is: \" + nohadzenyaNaimenshogoChusla);\n+        System.out.println(\"Середнє арифметичне 4-ох чисел: \" + seredneArufm);\n+        System.out.println(\"Числа меньші нуля: \" + nohadzenyaChuselMenshuxNylya);\n+        System.out.println(\"Числа більші нуля: \" + nohadzenyaChuselBilshuxNylya);\n+        System.out.println(\"Середнє арифметичне чисел більше 10: \" + nahodzennyaSerednogoArufCHuselBilshuxDecatu);\n+\n     }\n \n-    public static int multiply(int a, int b) {\n-        return a * b;\n+    public static int sum(int res1, int res2, int res3, int res4) {\n+        return res1 + res2 + res3 + res4;\n     }\n \n-    public static int divide(int a, int b) {\n-        return a / b;\n+    public static int multiply(int res1, int res2, int res3, int res4) {\n+        return res1 * res2 * res3 * res4;\n+    }\n+\n+    public static int seredneArufm(int res1, int res2, int res3, int res4) {\n+        return (res1 + res2 + res3 + res4) / 4;\n+    }\n+\n+\n+    public static int nohadzenyaNaibilshogoChusla(int res1, int res2, int res3, int res4) {\n+        if (res1 >= res2 && res1 >= res3 && res1 >= res4) {\n+            return res1;\n+        } else if (res2 >= res1 && res2 >= res3 && res2 >= res4) {\n+            return res2;\n+        } else if (res3 >= res1 && res3 >= res2 && res3 >= res4) {\n+            return res3;\n+        } else {\n+            return res4;\n+        }\n+\n+    }\n+\n+    public static int nohadzenyaNaimenshogoChusla(int res1, int res2, int res3, int res4) {\n+        if (res1 < res2 && res1 < res3 && res1 < res4) {\n+            return res1;\n+        } else if (res2 < res1 && res2 < res3 && res2 < res4) {\n+            return res2;\n+        } else if (res3 < res1 && res3 < res2 && res3 < res4) {\n+            return res3;\n+        } else {\n+            return res4;\n+        }\n+\n+    }\n+\n+    public static int nohadzenyaChuselMenshuxNylya(int res1, int res2, int res3, int res4) {\n+        int count = 0;\n+        if (res1 < 0) {\n+            count++;\n+        }\n+        if (res2 < 0) {\n+            count++;\n+        }\n+        if (res3 < 0) {\n+            count++;\n+        }\n+        if (res4 < 0) {\n+            count++;\n+        }\n+        return count;\n+    }\n+\n+    public static int nohadzenyaChuselBilshuxNylya(int res1, int res2, int res3, int res4) {\n+        int count = 0;\n+        if (res1 > 0) {\n+            count++;\n+        }\n+        if (res2 > 0) {\n+            count++;\n+        }\n+        if (res3 > 0) {\n+            count++;\n+        }\n+        if (res4 > 0) {\n+            count++;\n+        }\n+        return count;\n+    }\n+\n+    public static int nahodzennyaSerednogoArufCHuselBilshuxDecatu(int res1, int res2, int res3, int res4) {\n+        int count = 0, x = 0, x1 = 0, x2 = 0, x3 = 0;","path":"src/main/java/com/katsora/statements/calculator/Calculator.java","position":125,"original_position":125,"commit_id":"1716181e8a1f46ec2c4283e9929b7ca21847d87b","original_commit_id":"1716181e8a1f46ec2c4283e9929b7ca21847d87b","user":{"login":"balodza","id":1794503,"node_id":"MDQ6VXNlcjE3OTQ1MDM=","avatar_url":"https://avatars0.githubusercontent.com/u/1794503?v=4","gravatar_id":"","url":"https://api.github.com/users/balodza","html_url":"https://github.com/balodza","followers_url":"https://api.github.com/users/balodza/followers","following_url":"https://api.github.com/users/balodza/following{/other_user}","gists_url":"https://api.github.com/users/balodza/gists{/gist_id}","starred_url":"https://api.github.com/users/balodza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balodza/subscriptions","organizations_url":"https://api.github.com/users/balodza/orgs","repos_url":"https://api.github.com/users/balodza/repos","events_url":"https://api.github.com/users/balodza/events{/privacy}","received_events_url":"https://api.github.com/users/balodza/received_events","type":"User","site_admin":false},"body":"ку ку","created_at":"2018-10-17T13:08:19Z","updated_at":"2018-10-17T13:08:19Z","html_url":"https://github.com/balodza/taras_java_learning/pull/9#discussion_r225919723","pull_request_url":"https://api.github.com/repos/balodza/taras_java_learning/pulls/9","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/balodza/taras_java_learning/pulls/comments/225919723"},"html":{"href":"https://github.com/balodza/taras_java_learning/pull/9#discussion_r225919723"},"pull_request":{"href":"https://api.github.com/repos/balodza/taras_java_learning/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/balodza/taras_java_learning/pulls/9","id":223525466,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIzNTI1NDY2","html_url":"https://github.com/balodza/taras_java_learning/pull/9","diff_url":"https://github.com/balodza/taras_java_learning/pull/9.diff","patch_url":"https://github.com/balodza/taras_java_learning/pull/9.patch","issue_url":"https://api.github.com/repos/balodza/taras_java_learning/issues/9","number":9,"state":"open","locked":false,"title":"Програма калькулятор","user":{"login":"taraskatsora1","id":43336381,"node_id":"MDQ6VXNlcjQzMzM2Mzgx","avatar_url":"https://avatars3.githubusercontent.com/u/43336381?v=4","gravatar_id":"","url":"https://api.github.com/users/taraskatsora1","html_url":"https://github.com/taraskatsora1","followers_url":"https://api.github.com/users/taraskatsora1/followers","following_url":"https://api.github.com/users/taraskatsora1/following{/other_user}","gists_url":"https://api.github.com/users/taraskatsora1/gists{/gist_id}","starred_url":"https://api.github.com/users/taraskatsora1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taraskatsora1/subscriptions","organizations_url":"https://api.github.com/users/taraskatsora1/orgs","repos_url":"https://api.github.com/users/taraskatsora1/repos","events_url":"https://api.github.com/users/taraskatsora1/events{/privacy}","received_events_url":"https://api.github.com/users/taraskatsora1/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-17T09:15:11Z","updated_at":"2018-10-17T13:08:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"711640a1b9b7786c1dc6feac52529efee7e4d7ed","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/balodza/taras_java_learning/pulls/9/commits","review_comments_url":"https://api.github.com/repos/balodza/taras_java_learning/pulls/9/comments","review_comment_url":"https://api.github.com/repos/balodza/taras_java_learning/pulls/comments{/number}","comments_url":"https://api.github.com/repos/balodza/taras_java_learning/issues/9/comments","statuses_url":"https://api.github.com/repos/balodza/taras_java_learning/statuses/1716181e8a1f46ec2c4283e9929b7ca21847d87b","head":{"label":"balodza:Calculator","ref":"Calculator","sha":"1716181e8a1f46ec2c4283e9929b7ca21847d87b","user":{"login":"balodza","id":1794503,"node_id":"MDQ6VXNlcjE3OTQ1MDM=","avatar_url":"https://avatars0.githubusercontent.com/u/1794503?v=4","gravatar_id":"","url":"https://api.github.com/users/balodza","html_url":"https://github.com/balodza","followers_url":"https://api.github.com/users/balodza/followers","following_url":"https://api.github.com/users/balodza/following{/other_user}","gists_url":"https://api.github.com/users/balodza/gists{/gist_id}","starred_url":"https://api.github.com/users/balodza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balodza/subscriptions","organizations_url":"https://api.github.com/users/balodza/orgs","repos_url":"https://api.github.com/users/balodza/repos","events_url":"https://api.github.com/users/balodza/events{/privacy}","received_events_url":"https://api.github.com/users/balodza/received_events","type":"User","site_admin":false},"repo":{"id":149094768,"node_id":"MDEwOlJlcG9zaXRvcnkxNDkwOTQ3Njg=","name":"taras_java_learning","full_name":"balodza/taras_java_learning","private":false,"owner":{"login":"balodza","id":1794503,"node_id":"MDQ6VXNlcjE3OTQ1MDM=","avatar_url":"https://avatars0.githubusercontent.com/u/1794503?v=4","gravatar_id":"","url":"https://api.github.com/users/balodza","html_url":"https://github.com/balodza","followers_url":"https://api.github.com/users/balodza/followers","following_url":"https://api.github.com/users/balodza/following{/other_user}","gists_url":"https://api.github.com/users/balodza/gists{/gist_id}","starred_url":"https://api.github.com/users/balodza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balodza/subscriptions","organizations_url":"https://api.github.com/users/balodza/orgs","repos_url":"https://api.github.com/users/balodza/repos","events_url":"https://api.github.com/users/balodza/events{/privacy}","received_events_url":"https://api.github.com/users/balodza/received_events","type":"User","site_admin":false},"html_url":"https://github.com/balodza/taras_java_learning","description":null,"fork":false,"url":"https://api.github.com/repos/balodza/taras_java_learning","forks_url":"https://api.github.com/repos/balodza/taras_java_learning/forks","keys_url":"https://api.github.com/repos/balodza/taras_java_learning/keys{/key_id}","collaborators_url":"https://api.github.com/repos/balodza/taras_java_learning/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/balodza/taras_java_learning/teams","hooks_url":"https://api.github.com/repos/balodza/taras_java_learning/hooks","issue_events_url":"https://api.github.com/repos/balodza/taras_java_learning/issues/events{/number}","events_url":"https://api.github.com/repos/balodza/taras_java_learning/events","assignees_url":"https://api.github.com/repos/balodza/taras_java_learning/assignees{/user}","branches_url":"https://api.github.com/repos/balodza/taras_java_learning/branches{/branch}","tags_url":"https://api.github.com/repos/balodza/taras_java_learning/tags","blobs_url":"https://api.github.com/repos/balodza/taras_java_learning/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/balodza/taras_java_learning/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/balodza/taras_java_learning/git/refs{/sha}","trees_url":"https://api.github.com/repos/balodza/taras_java_learning/git/trees{/sha}","statuses_url":"https://api.github.com/repos/balodza/taras_java_learning/statuses/{sha}","languages_url":"https://api.github.com/repos/balodza/taras_java_learning/languages","stargazers_url":"https://api.github.com/repos/balodza/taras_java_learning/stargazers","contributors_url":"https://api.github.com/repos/balodza/taras_java_learning/contributors","subscribers_url":"https://api.github.com/repos/balodza/taras_java_learning/subscribers","subscription_url":"https://api.github.com/repos/balodza/taras_java_learning/subscription","commits_url":"https://api.github.com/repos/balodza/taras_java_learning/commits{/sha}","git_commits_url":"https://api.github.com/repos/balodza/taras_java_learning/git/commits{/sha}","comments_url":"https://api.github.com/repos/balodza/taras_java_learning/comments{/number}","issue_comment_url":"https://api.github.com/repos/balodza/taras_java_learning/issues/comments{/number}","contents_url":"https://api.github.com/repos/balodza/taras_java_learning/contents/{+path}","compare_url":"https://api.github.com/repos/balodza/taras_java_learning/compare/{base}...{head}","merges_url":"https://api.github.com/repos/balodza/taras_java_learning/merges","archive_url":"https://api.github.com/repos/balodza/taras_java_learning/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/balodza/taras_java_learning/downloads","issues_url":"https://api.github.com/repos/balodza/taras_java_learning/issues{/number}","pulls_url":"https://api.github.com/repos/balodza/taras_java_learning/pulls{/number}","milestones_url":"https://api.github.com/repos/balodza/taras_java_learning/milestones{/number}","notifications_url":"https://api.github.com/repos/balodza/taras_java_learning/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/balodza/taras_java_learning/labels{/name}","releases_url":"https://api.github.com/repos/balodza/taras_java_learning/releases{/id}","deployments_url":"https://api.github.com/repos/balodza/taras_java_learning/deployments","created_at":"2018-09-17T08:41:30Z","updated_at":"2018-10-17T09:16:58Z","pushed_at":"2018-10-17T13:05:05Z","git_url":"git://github.com/balodza/taras_java_learning.git","ssh_url":"git@github.com:balodza/taras_java_learning.git","clone_url":"https://github.com/balodza/taras_java_learning.git","svn_url":"https://github.com/balodza/taras_java_learning","homepage":null,"size":67,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"balodza:master","ref":"master","sha":"af83e783473565c10a4a888a3b482ae3e3ec67b8","user":{"login":"balodza","id":1794503,"node_id":"MDQ6VXNlcjE3OTQ1MDM=","avatar_url":"https://avatars0.githubusercontent.com/u/1794503?v=4","gravatar_id":"","url":"https://api.github.com/users/balodza","html_url":"https://github.com/balodza","followers_url":"https://api.github.com/users/balodza/followers","following_url":"https://api.github.com/users/balodza/following{/other_user}","gists_url":"https://api.github.com/users/balodza/gists{/gist_id}","starred_url":"https://api.github.com/users/balodza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balodza/subscriptions","organizations_url":"https://api.github.com/users/balodza/orgs","repos_url":"https://api.github.com/users/balodza/repos","events_url":"https://api.github.com/users/balodza/events{/privacy}","received_events_url":"https://api.github.com/users/balodza/received_events","type":"User","site_admin":false},"repo":{"id":149094768,"node_id":"MDEwOlJlcG9zaXRvcnkxNDkwOTQ3Njg=","name":"taras_java_learning","full_name":"balodza/taras_java_learning","private":false,"owner":{"login":"balodza","id":1794503,"node_id":"MDQ6VXNlcjE3OTQ1MDM=","avatar_url":"https://avatars0.githubusercontent.com/u/1794503?v=4","gravatar_id":"","url":"https://api.github.com/users/balodza","html_url":"https://github.com/balodza","followers_url":"https://api.github.com/users/balodza/followers","following_url":"https://api.github.com/users/balodza/following{/other_user}","gists_url":"https://api.github.com/users/balodza/gists{/gist_id}","starred_url":"https://api.github.com/users/balodza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balodza/subscriptions","organizations_url":"https://api.github.com/users/balodza/orgs","repos_url":"https://api.github.com/users/balodza/repos","events_url":"https://api.github.com/users/balodza/events{/privacy}","received_events_url":"https://api.github.com/users/balodza/received_events","type":"User","site_admin":false},"html_url":"https://github.com/balodza/taras_java_learning","description":null,"fork":false,"url":"https://api.github.com/repos/balodza/taras_java_learning","forks_url":"https://api.github.com/repos/balodza/taras_java_learning/forks","keys_url":"https://api.github.com/repos/balodza/taras_java_learning/keys{/key_id}","collaborators_url":"https://api.github.com/repos/balodza/taras_java_learning/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/balodza/taras_java_learning/teams","hooks_url":"https://api.github.com/repos/balodza/taras_java_learning/hooks","issue_events_url":"https://api.github.com/repos/balodza/taras_java_learning/issues/events{/number}","events_url":"https://api.github.com/repos/balodza/taras_java_learning/events","assignees_url":"https://api.github.com/repos/balodza/taras_java_learning/assignees{/user}","branches_url":"https://api.github.com/repos/balodza/taras_java_learning/branches{/branch}","tags_url":"https://api.github.com/repos/balodza/taras_java_learning/tags","blobs_url":"https://api.github.com/repos/balodza/taras_java_learning/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/balodza/taras_java_learning/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/balodza/taras_java_learning/git/refs{/sha}","trees_url":"https://api.github.com/repos/balodza/taras_java_learning/git/trees{/sha}","statuses_url":"https://api.github.com/repos/balodza/taras_java_learning/statuses/{sha}","languages_url":"https://api.github.com/repos/balodza/taras_java_learning/languages","stargazers_url":"https://api.github.com/repos/balodza/taras_java_learning/stargazers","contributors_url":"https://api.github.com/repos/balodza/taras_java_learning/contributors","subscribers_url":"https://api.github.com/repos/balodza/taras_java_learning/subscribers","subscription_url":"https://api.github.com/repos/balodza/taras_java_learning/subscription","commits_url":"https://api.github.com/repos/balodza/taras_java_learning/commits{/sha}","git_commits_url":"https://api.github.com/repos/balodza/taras_java_learning/git/commits{/sha}","comments_url":"https://api.github.com/repos/balodza/taras_java_learning/comments{/number}","issue_comment_url":"https://api.github.com/repos/balodza/taras_java_learning/issues/comments{/number}","contents_url":"https://api.github.com/repos/balodza/taras_java_learning/contents/{+path}","compare_url":"https://api.github.com/repos/balodza/taras_java_learning/compare/{base}...{head}","merges_url":"https://api.github.com/repos/balodza/taras_java_learning/merges","archive_url":"https://api.github.com/repos/balodza/taras_java_learning/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/balodza/taras_java_learning/downloads","issues_url":"https://api.github.com/repos/balodza/taras_java_learning/issues{/number}","pulls_url":"https://api.github.com/repos/balodza/taras_java_learning/pulls{/number}","milestones_url":"https://api.github.com/repos/balodza/taras_java_learning/milestones{/number}","notifications_url":"https://api.github.com/repos/balodza/taras_java_learning/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/balodza/taras_java_learning/labels{/name}","releases_url":"https://api.github.com/repos/balodza/taras_java_learning/releases{/id}","deployments_url":"https://api.github.com/repos/balodza/taras_java_learning/deployments","created_at":"2018-09-17T08:41:30Z","updated_at":"2018-10-17T09:16:58Z","pushed_at":"2018-10-17T13:05:05Z","git_url":"git://github.com/balodza/taras_java_learning.git","ssh_url":"git@github.com:balodza/taras_java_learning.git","clone_url":"https://github.com/balodza/taras_java_learning.git","svn_url":"https://github.com/balodza/taras_java_learning","homepage":null,"size":67,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/balodza/taras_java_learning/pulls/9"},"html":{"href":"https://github.com/balodza/taras_java_learning/pull/9"},"issue":{"href":"https://api.github.com/repos/balodza/taras_java_learning/issues/9"},"comments":{"href":"https://api.github.com/repos/balodza/taras_java_learning/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/balodza/taras_java_learning/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/balodza/taras_java_learning/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/balodza/taras_java_learning/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/balodza/taras_java_learning/statuses/1716181e8a1f46ec2c4283e9929b7ca21847d87b"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"balodza"}}