{"action":"created","comment":{"url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/pulls/comments/194780293","pull_request_review_id":128014033,"id":194780293,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDc4MDI5Mw==","diff_hunk":"@@ -0,0 +1,138 @@\n+/**\n+ * Requirements:\n+ *\n+ * Implement a bubble sort algorithm to sort an array of SalesRepresentative objects in descending order.\n+ * The sorting should be done based on the amount of revenue generated via sales.\n+ * Each rep has a number of sales, and a quota / sale.\n+ *\n+ * After the sorting, the first object should be the rep with the most revenue generated.\n+ * The last object in the array should be the rep with the least revenue generated.\n+ *\n+ * E.g\n+ *\n+ * Sales guy 1 has 10 sales with a quota of 500$. He has achieved 5000$ worth of sales.\n+ *\n+ * Sales guy 2 has 7 sales with a quota of 800$. He has achieved 5600$ worth of sales.\n+ *\n+ *\n+ * Sorting code example:\n+ *\n+ * SalesRepresentative [ ] reps = ...\n+ *\n+ * SalesRepresentative [ ] sortedReps = sort(reps);\n+ *\n+ * // you need to implement the sort(SalesRepresentative [ ] reps) method. This can not be a static method.\n+ */\n+\n+\n+import java.util.Arrays;\n+\n+public class BubbleSort {\n+    public static void main(String[] args) {\n+        int salesRepresentative[] = new int[]{1, 2, 3, 4, 5};\n+\n+        int numberOfSales[] = new int[]{10, 7, 5, 8, 9};\n+        int list[] = new int[]{500, 800, 400, 900, 700};\n+\n+\n+        System.out.println(\"Primul tabel inainte de transformare este: \");\n+        for (int n = 0; n < 5; n++) {\n+\n+            System.out.println(salesRepresentative[n] + \" ..... \" + numberOfSales[n] + \"......\" + list[n]);\n+        }\n+        System.out.println(\"Lista dupa aplicarea metodei Boubble sort este:\" + \"\");\n+\n+\n+        int bestQuotaSale = getBestQuotaSale(list, salesRepresentative);\n+        for (int i = 0; i < list.length; i++) {\n+\n+        }\n+    }\n+\n+    public static int getBestQuotaSale(int[] list, int[] salesRepresentative) {\n+\n+        int temp;\n+        boolean fixed = false;\n+        while (fixed == false) {\n+            fixed = true;\n+\n+            for (int i = 0; i < list.length - 1; i++) {\n+                if (list[i] < list[i + 1]) {\n+                    temp = list[i + 1];\n+                    list[i + 1] = list[i];\n+                    list[i] = temp;\n+                    fixed = false;\n+\n+                }\n+\n+            }\n+            for (int i = 0; i < list.length; i++) {\n+                System.out.println(list[i] + \"    \");\n+            }\n+\n+\n+        }\n+        return list.length;\n+\n+    }\n+\n+    /**\n+     * Pana aici se compileaza perfect;\n+     * De aici incolo nu imi da nici o eroare dar nici nu am reusit sa il fac\n+     * sa se aranjeze asa cum ar fi trebuit!\n+     * Si nu inteleg de ce?!!!!!\n+     */\n+\n+    public int sortSalesRepresentative(int[] salesRepresentative) {\n+\n+        int temp1;\n+\n+        for (int i = 0; i < 5; i++) {","path":"BubbleSort/src/BubbleSort.java","position":90,"original_position":90,"commit_id":"19c2fcffd6cada0c1138f4112d55bb4af610162a","original_commit_id":"19c2fcffd6cada0c1138f4112d55bb4af610162a","user":{"login":"MelindaFancsal","id":38004428,"node_id":"MDQ6VXNlcjM4MDA0NDI4","avatar_url":"https://avatars2.githubusercontent.com/u/38004428?v=4","gravatar_id":"","url":"https://api.github.com/users/MelindaFancsal","html_url":"https://github.com/MelindaFancsal","followers_url":"https://api.github.com/users/MelindaFancsal/followers","following_url":"https://api.github.com/users/MelindaFancsal/following{/other_user}","gists_url":"https://api.github.com/users/MelindaFancsal/gists{/gist_id}","starred_url":"https://api.github.com/users/MelindaFancsal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MelindaFancsal/subscriptions","organizations_url":"https://api.github.com/users/MelindaFancsal/orgs","repos_url":"https://api.github.com/users/MelindaFancsal/repos","events_url":"https://api.github.com/users/MelindaFancsal/events{/privacy}","received_events_url":"https://api.github.com/users/MelindaFancsal/received_events","type":"User","site_admin":false},"body":"i don t understand why did you use this for (int i =0; i<5; i++) ? You didn t worked with it in the sorting process.\r\nBubble sort method example:\r\n\r\n```\r\nprivate static int [] bublesort (int[] list , int length) {\r\n    boolean swap = true;\r\n    int temp;\r\n\r\n    while(swap){\r\n        swap = false;\r\n        for(int i = 0;i < list.length-1; i++){              \r\n            if(list[i] > list[i+1]){\r\n                temp = list[i];\r\n                list[i] = list[i+1];\r\n                list[i+1] = temp;                   \r\n                swap = true;\r\n            }\r\n        }\r\n    }\r\n\r\n    return list;\r\n}\r\n\r\n```","created_at":"2018-06-12T15:18:28Z","updated_at":"2018-06-12T15:19:07Z","html_url":"https://github.com/gabrielagagea/scoala-informala-homeworks/pull/2#discussion_r194780293","pull_request_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/pulls/2","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/pulls/comments/194780293"},"html":{"href":"https://github.com/gabrielagagea/scoala-informala-homeworks/pull/2#discussion_r194780293"},"pull_request":{"href":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/pulls/2","id":192793818,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyNzkzODE4","html_url":"https://github.com/gabrielagagea/scoala-informala-homeworks/pull/2","diff_url":"https://github.com/gabrielagagea/scoala-informala-homeworks/pull/2.diff","patch_url":"https://github.com/gabrielagagea/scoala-informala-homeworks/pull/2.patch","issue_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/issues/2","number":2,"state":"open","locked":false,"title":"tema 2","user":{"login":"gabrielagagea","id":38765002,"node_id":"MDQ6VXNlcjM4NzY1MDAy","avatar_url":"https://avatars2.githubusercontent.com/u/38765002?v=4","gravatar_id":"","url":"https://api.github.com/users/gabrielagagea","html_url":"https://github.com/gabrielagagea","followers_url":"https://api.github.com/users/gabrielagagea/followers","following_url":"https://api.github.com/users/gabrielagagea/following{/other_user}","gists_url":"https://api.github.com/users/gabrielagagea/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrielagagea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrielagagea/subscriptions","organizations_url":"https://api.github.com/users/gabrielagagea/orgs","repos_url":"https://api.github.com/users/gabrielagagea/repos","events_url":"https://api.github.com/users/gabrielagagea/events{/privacy}","received_events_url":"https://api.github.com/users/gabrielagagea/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-05T18:16:00Z","updated_at":"2018-06-12T15:19:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1b07f85b48706f39c19ca8e05d18b43ea45eb194","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/pulls/2/commits","review_comments_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/pulls/2/comments","review_comment_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/issues/2/comments","statuses_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/statuses/19c2fcffd6cada0c1138f4112d55bb4af610162a","head":{"label":"gabrielagagea:functionsTema2","ref":"functionsTema2","sha":"19c2fcffd6cada0c1138f4112d55bb4af610162a","user":{"login":"gabrielagagea","id":38765002,"node_id":"MDQ6VXNlcjM4NzY1MDAy","avatar_url":"https://avatars2.githubusercontent.com/u/38765002?v=4","gravatar_id":"","url":"https://api.github.com/users/gabrielagagea","html_url":"https://github.com/gabrielagagea","followers_url":"https://api.github.com/users/gabrielagagea/followers","following_url":"https://api.github.com/users/gabrielagagea/following{/other_user}","gists_url":"https://api.github.com/users/gabrielagagea/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrielagagea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrielagagea/subscriptions","organizations_url":"https://api.github.com/users/gabrielagagea/orgs","repos_url":"https://api.github.com/users/gabrielagagea/repos","events_url":"https://api.github.com/users/gabrielagagea/events{/privacy}","received_events_url":"https://api.github.com/users/gabrielagagea/received_events","type":"User","site_admin":false},"repo":{"id":132015751,"node_id":"MDEwOlJlcG9zaXRvcnkxMzIwMTU3NTE=","name":"scoala-informala-homeworks","full_name":"gabrielagagea/scoala-informala-homeworks","owner":{"login":"gabrielagagea","id":38765002,"node_id":"MDQ6VXNlcjM4NzY1MDAy","avatar_url":"https://avatars2.githubusercontent.com/u/38765002?v=4","gravatar_id":"","url":"https://api.github.com/users/gabrielagagea","html_url":"https://github.com/gabrielagagea","followers_url":"https://api.github.com/users/gabrielagagea/followers","following_url":"https://api.github.com/users/gabrielagagea/following{/other_user}","gists_url":"https://api.github.com/users/gabrielagagea/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrielagagea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrielagagea/subscriptions","organizations_url":"https://api.github.com/users/gabrielagagea/orgs","repos_url":"https://api.github.com/users/gabrielagagea/repos","events_url":"https://api.github.com/users/gabrielagagea/events{/privacy}","received_events_url":"https://api.github.com/users/gabrielagagea/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gabrielagagea/scoala-informala-homeworks","description":null,"fork":false,"url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks","forks_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/forks","keys_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/teams","hooks_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/hooks","issue_events_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/issues/events{/number}","events_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/events","assignees_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/assignees{/user}","branches_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/branches{/branch}","tags_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/tags","blobs_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/git/refs{/sha}","trees_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/statuses/{sha}","languages_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/languages","stargazers_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/stargazers","contributors_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/contributors","subscribers_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/subscribers","subscription_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/subscription","commits_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/commits{/sha}","git_commits_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/git/commits{/sha}","comments_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/comments{/number}","issue_comment_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/issues/comments{/number}","contents_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/contents/{+path}","compare_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/merges","archive_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/downloads","issues_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/issues{/number}","pulls_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/pulls{/number}","milestones_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/milestones{/number}","notifications_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/labels{/name}","releases_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/releases{/id}","deployments_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/deployments","created_at":"2018-05-03T15:34:20Z","updated_at":"2018-06-08T18:23:53Z","pushed_at":"2018-06-10T15:22:09Z","git_url":"git://github.com/gabrielagagea/scoala-informala-homeworks.git","ssh_url":"git@github.com:gabrielagagea/scoala-informala-homeworks.git","clone_url":"https://github.com/gabrielagagea/scoala-informala-homeworks.git","svn_url":"https://github.com/gabrielagagea/scoala-informala-homeworks","homepage":null,"size":125,"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":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"gabrielagagea:master","ref":"master","sha":"1e85bc7573582204a64d036a494202e8a9b5c117","user":{"login":"gabrielagagea","id":38765002,"node_id":"MDQ6VXNlcjM4NzY1MDAy","avatar_url":"https://avatars2.githubusercontent.com/u/38765002?v=4","gravatar_id":"","url":"https://api.github.com/users/gabrielagagea","html_url":"https://github.com/gabrielagagea","followers_url":"https://api.github.com/users/gabrielagagea/followers","following_url":"https://api.github.com/users/gabrielagagea/following{/other_user}","gists_url":"https://api.github.com/users/gabrielagagea/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrielagagea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrielagagea/subscriptions","organizations_url":"https://api.github.com/users/gabrielagagea/orgs","repos_url":"https://api.github.com/users/gabrielagagea/repos","events_url":"https://api.github.com/users/gabrielagagea/events{/privacy}","received_events_url":"https://api.github.com/users/gabrielagagea/received_events","type":"User","site_admin":false},"repo":{"id":132015751,"node_id":"MDEwOlJlcG9zaXRvcnkxMzIwMTU3NTE=","name":"scoala-informala-homeworks","full_name":"gabrielagagea/scoala-informala-homeworks","owner":{"login":"gabrielagagea","id":38765002,"node_id":"MDQ6VXNlcjM4NzY1MDAy","avatar_url":"https://avatars2.githubusercontent.com/u/38765002?v=4","gravatar_id":"","url":"https://api.github.com/users/gabrielagagea","html_url":"https://github.com/gabrielagagea","followers_url":"https://api.github.com/users/gabrielagagea/followers","following_url":"https://api.github.com/users/gabrielagagea/following{/other_user}","gists_url":"https://api.github.com/users/gabrielagagea/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrielagagea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrielagagea/subscriptions","organizations_url":"https://api.github.com/users/gabrielagagea/orgs","repos_url":"https://api.github.com/users/gabrielagagea/repos","events_url":"https://api.github.com/users/gabrielagagea/events{/privacy}","received_events_url":"https://api.github.com/users/gabrielagagea/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gabrielagagea/scoala-informala-homeworks","description":null,"fork":false,"url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks","forks_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/forks","keys_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/teams","hooks_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/hooks","issue_events_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/issues/events{/number}","events_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/events","assignees_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/assignees{/user}","branches_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/branches{/branch}","tags_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/tags","blobs_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/git/refs{/sha}","trees_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/statuses/{sha}","languages_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/languages","stargazers_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/stargazers","contributors_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/contributors","subscribers_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/subscribers","subscription_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/subscription","commits_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/commits{/sha}","git_commits_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/git/commits{/sha}","comments_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/comments{/number}","issue_comment_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/issues/comments{/number}","contents_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/contents/{+path}","compare_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/merges","archive_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/downloads","issues_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/issues{/number}","pulls_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/pulls{/number}","milestones_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/milestones{/number}","notifications_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/labels{/name}","releases_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/releases{/id}","deployments_url":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/deployments","created_at":"2018-05-03T15:34:20Z","updated_at":"2018-06-08T18:23:53Z","pushed_at":"2018-06-10T15:22:09Z","git_url":"git://github.com/gabrielagagea/scoala-informala-homeworks.git","ssh_url":"git@github.com:gabrielagagea/scoala-informala-homeworks.git","clone_url":"https://github.com/gabrielagagea/scoala-informala-homeworks.git","svn_url":"https://github.com/gabrielagagea/scoala-informala-homeworks","homepage":null,"size":125,"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":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/pulls/2"},"html":{"href":"https://github.com/gabrielagagea/scoala-informala-homeworks/pull/2"},"issue":{"href":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/issues/2"},"comments":{"href":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/gabrielagagea/scoala-informala-homeworks/statuses/19c2fcffd6cada0c1138f4112d55bb4af610162a"}},"author_association":"OWNER"}}
{"actor":{"display_login":"MelindaFancsal"}}