{"action":"created","comment":{"url":"https://api.github.com/repos/Ada-C9/Calculator/pulls/comments/167418371","pull_request_review_id":95640145,"id":167418371,"diff_hunk":"@@ -0,0 +1,102 @@\n+\n+#method within the string class that returns false if element cannot be converted into a float\n+class String\n+  def valid_float?\n+    true if Float self rescue false\n+  end\n+end\n+\n+#addition method\n+def addition (num1, num2)\n+  num1 + num2\n+end\n+\n+#subtraction method\n+def subtraction (num1, num2)\n+  num1 - num2\n+end\n+\n+#multiplication method\n+def multiplication (num1, num2)\n+  num1 * num2\n+end\n+\n+#division method\n+def division (num1, num2)\n+  answer = num1.to_f / num2\n+end\n+\n+#exponent method\n+def exponential (num1, num2)\n+  num1 ** num2\n+end\n+\n+#modulo method\n+def modulo (num1, num2)\n+  num1 % num2\n+end\n+#array of possible operators\n+ops_symbol = [\"*\", \"-\", \"+\", \"/\", \"^\", \"%\"]\n+ops_spelled = [\"add\", \"subtract\", \"multiply\", \"divide\", \"exponent\", \"modulo\"]\n+\n+#beginning of output\n+puts \"Welcome to the calculator app! \"\n+\n+#prompts for user inputs\n+puts \"Please enter a number: \"\n+user_num1 = gets.chomp\n+while user_num1.valid_float? == false\n+  puts \"Please enter a real number: \"\n+  user_num1 = gets.chomp\n+end\n+user_num_one = user_num1.to_i\n+\n+puts \"Please enter a number: \"\n+user_num2 = gets.chomp\n+while user_num2.valid_float? == false\n+  puts \"Please enter a real number: \"\n+  user_num2 = gets.chomp\n+end\n+user_num_two = user_num2.to_i\n+\n+\n+puts \"Please enter one of the following operations: add(+), subtract(-), multiple(*), divide(/), exponent(^), modulo(%)\"\n+user_operator = gets.chomp\n+\n+\n+#checks that operator matches something from the array of operators\n+until (ops_symbol.include? user_operator) || (ops_spelled.include? user_operator)\n+  puts \"Sorry, I can't process that. Please enter a operator: \"\n+  user_operator = gets.chomp\n+end\n+\n+#does not let the user divide by 0, re-prompts for the second number\n+if (user_operator == \"/\" or user_operator == \"divide\") && user_num2 == 0\n+    puts \"Sorry. You can't divide by zero! Please choose something else. \"","path":"calculator.rb","position":75,"original_position":75,"commit_id":"ef52183860ab220740ee6c2ab12d3b30f2561a5f","original_commit_id":"ef52183860ab220740ee6c2ab12d3b30f2561a5f","user":{"login":"CheezItMan","id":1177416,"avatar_url":"https://avatars3.githubusercontent.com/u/1177416?v=4","gravatar_id":"","url":"https://api.github.com/users/CheezItMan","html_url":"https://github.com/CheezItMan","followers_url":"https://api.github.com/users/CheezItMan/followers","following_url":"https://api.github.com/users/CheezItMan/following{/other_user}","gists_url":"https://api.github.com/users/CheezItMan/gists{/gist_id}","starred_url":"https://api.github.com/users/CheezItMan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CheezItMan/subscriptions","organizations_url":"https://api.github.com/users/CheezItMan/orgs","repos_url":"https://api.github.com/users/CheezItMan/repos","events_url":"https://api.github.com/users/CheezItMan/events{/privacy}","received_events_url":"https://api.github.com/users/CheezItMan/received_events","type":"User","site_admin":false},"body":"You have also indented a bit much here.  In general indent either one tab or two spaces, just do it consistently.","created_at":"2018-02-11T03:12:40Z","updated_at":"2018-02-11T03:17:11Z","html_url":"https://github.com/Ada-C9/Calculator/pull/18#discussion_r167418371","pull_request_url":"https://api.github.com/repos/Ada-C9/Calculator/pulls/18","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Ada-C9/Calculator/pulls/comments/167418371"},"html":{"href":"https://github.com/Ada-C9/Calculator/pull/18#discussion_r167418371"},"pull_request":{"href":"https://api.github.com/repos/Ada-C9/Calculator/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/Ada-C9/Calculator/pulls/18","id":167775046,"html_url":"https://github.com/Ada-C9/Calculator/pull/18","diff_url":"https://github.com/Ada-C9/Calculator/pull/18.diff","patch_url":"https://github.com/Ada-C9/Calculator/pull/18.patch","issue_url":"https://api.github.com/repos/Ada-C9/Calculator/issues/18","number":18,"state":"open","locked":false,"title":"Angela Hu - Calculator - Octos","user":{"login":"knockknockhusthere","id":24285608,"avatar_url":"https://avatars3.githubusercontent.com/u/24285608?v=4","gravatar_id":"","url":"https://api.github.com/users/knockknockhusthere","html_url":"https://github.com/knockknockhusthere","followers_url":"https://api.github.com/users/knockknockhusthere/followers","following_url":"https://api.github.com/users/knockknockhusthere/following{/other_user}","gists_url":"https://api.github.com/users/knockknockhusthere/gists{/gist_id}","starred_url":"https://api.github.com/users/knockknockhusthere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knockknockhusthere/subscriptions","organizations_url":"https://api.github.com/users/knockknockhusthere/orgs","repos_url":"https://api.github.com/users/knockknockhusthere/repos","events_url":"https://api.github.com/users/knockknockhusthere/events{/privacy}","received_events_url":"https://api.github.com/users/knockknockhusthere/received_events","type":"User","site_admin":false},"body":"# Calculator\r\nCongratulations! You're submitting your assignment.\r\n\r\n## Comprehension Questions\r\n\r\n|  Question \t|  Answer \t|\r\n|---\t|---\t|\r\n|  Describe how you stored user input in your program?\t|  I stored user input in a variable\t|\r\n|  How did you determine what operation to perform?\t|   I ran through a case statement to compare against user's inputted operator string. |\r\n|  Do you feel like you used consistent indentation throughout your code? \t|   It got a little crazy re-factoring towards the end, but yes it should be consistent\t|\r\n|  If you had more time, what would you have added to or changed about the program? \t|   I would see that the program knows when to return a float or an integer. Also I would have familiarized myself with regex and used that instead.|\r\n","created_at":"2018-02-07T18:39:21Z","updated_at":"2018-02-11T03:17:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af14a18d7eb017e8d1bd8c0ce29d7b824ab79e30","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Ada-C9/Calculator/pulls/18/commits","review_comments_url":"https://api.github.com/repos/Ada-C9/Calculator/pulls/18/comments","review_comment_url":"https://api.github.com/repos/Ada-C9/Calculator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ada-C9/Calculator/issues/18/comments","statuses_url":"https://api.github.com/repos/Ada-C9/Calculator/statuses/ef52183860ab220740ee6c2ab12d3b30f2561a5f","head":{"label":"knockknockhusthere:master","ref":"master","sha":"ef52183860ab220740ee6c2ab12d3b30f2561a5f","user":{"login":"knockknockhusthere","id":24285608,"avatar_url":"https://avatars3.githubusercontent.com/u/24285608?v=4","gravatar_id":"","url":"https://api.github.com/users/knockknockhusthere","html_url":"https://github.com/knockknockhusthere","followers_url":"https://api.github.com/users/knockknockhusthere/followers","following_url":"https://api.github.com/users/knockknockhusthere/following{/other_user}","gists_url":"https://api.github.com/users/knockknockhusthere/gists{/gist_id}","starred_url":"https://api.github.com/users/knockknockhusthere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knockknockhusthere/subscriptions","organizations_url":"https://api.github.com/users/knockknockhusthere/orgs","repos_url":"https://api.github.com/users/knockknockhusthere/repos","events_url":"https://api.github.com/users/knockknockhusthere/events{/privacy}","received_events_url":"https://api.github.com/users/knockknockhusthere/received_events","type":"User","site_admin":false},"repo":{"id":120653947,"name":"Calculator","full_name":"knockknockhusthere/Calculator","owner":{"login":"knockknockhusthere","id":24285608,"avatar_url":"https://avatars3.githubusercontent.com/u/24285608?v=4","gravatar_id":"","url":"https://api.github.com/users/knockknockhusthere","html_url":"https://github.com/knockknockhusthere","followers_url":"https://api.github.com/users/knockknockhusthere/followers","following_url":"https://api.github.com/users/knockknockhusthere/following{/other_user}","gists_url":"https://api.github.com/users/knockknockhusthere/gists{/gist_id}","starred_url":"https://api.github.com/users/knockknockhusthere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knockknockhusthere/subscriptions","organizations_url":"https://api.github.com/users/knockknockhusthere/orgs","repos_url":"https://api.github.com/users/knockknockhusthere/repos","events_url":"https://api.github.com/users/knockknockhusthere/events{/privacy}","received_events_url":"https://api.github.com/users/knockknockhusthere/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/knockknockhusthere/Calculator","description":"Calculator Exercise","fork":true,"url":"https://api.github.com/repos/knockknockhusthere/Calculator","forks_url":"https://api.github.com/repos/knockknockhusthere/Calculator/forks","keys_url":"https://api.github.com/repos/knockknockhusthere/Calculator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/knockknockhusthere/Calculator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/knockknockhusthere/Calculator/teams","hooks_url":"https://api.github.com/repos/knockknockhusthere/Calculator/hooks","issue_events_url":"https://api.github.com/repos/knockknockhusthere/Calculator/issues/events{/number}","events_url":"https://api.github.com/repos/knockknockhusthere/Calculator/events","assignees_url":"https://api.github.com/repos/knockknockhusthere/Calculator/assignees{/user}","branches_url":"https://api.github.com/repos/knockknockhusthere/Calculator/branches{/branch}","tags_url":"https://api.github.com/repos/knockknockhusthere/Calculator/tags","blobs_url":"https://api.github.com/repos/knockknockhusthere/Calculator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/knockknockhusthere/Calculator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/knockknockhusthere/Calculator/git/refs{/sha}","trees_url":"https://api.github.com/repos/knockknockhusthere/Calculator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/knockknockhusthere/Calculator/statuses/{sha}","languages_url":"https://api.github.com/repos/knockknockhusthere/Calculator/languages","stargazers_url":"https://api.github.com/repos/knockknockhusthere/Calculator/stargazers","contributors_url":"https://api.github.com/repos/knockknockhusthere/Calculator/contributors","subscribers_url":"https://api.github.com/repos/knockknockhusthere/Calculator/subscribers","subscription_url":"https://api.github.com/repos/knockknockhusthere/Calculator/subscription","commits_url":"https://api.github.com/repos/knockknockhusthere/Calculator/commits{/sha}","git_commits_url":"https://api.github.com/repos/knockknockhusthere/Calculator/git/commits{/sha}","comments_url":"https://api.github.com/repos/knockknockhusthere/Calculator/comments{/number}","issue_comment_url":"https://api.github.com/repos/knockknockhusthere/Calculator/issues/comments{/number}","contents_url":"https://api.github.com/repos/knockknockhusthere/Calculator/contents/{+path}","compare_url":"https://api.github.com/repos/knockknockhusthere/Calculator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/knockknockhusthere/Calculator/merges","archive_url":"https://api.github.com/repos/knockknockhusthere/Calculator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/knockknockhusthere/Calculator/downloads","issues_url":"https://api.github.com/repos/knockknockhusthere/Calculator/issues{/number}","pulls_url":"https://api.github.com/repos/knockknockhusthere/Calculator/pulls{/number}","milestones_url":"https://api.github.com/repos/knockknockhusthere/Calculator/milestones{/number}","notifications_url":"https://api.github.com/repos/knockknockhusthere/Calculator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/knockknockhusthere/Calculator/labels{/name}","releases_url":"https://api.github.com/repos/knockknockhusthere/Calculator/releases{/id}","deployments_url":"https://api.github.com/repos/knockknockhusthere/Calculator/deployments","created_at":"2018-02-07T18:25:26Z","updated_at":"2018-02-07T18:28:51Z","pushed_at":"2018-02-07T18:28:50Z","git_url":"git://github.com/knockknockhusthere/Calculator.git","ssh_url":"git@github.com:knockknockhusthere/Calculator.git","clone_url":"https://github.com/knockknockhusthere/Calculator.git","svn_url":"https://github.com/knockknockhusthere/Calculator","homepage":"","size":11,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"Ada-C9:master","ref":"master","sha":"3ed0687e50e8e935410be35bdff5c9313bfb474d","user":{"login":"Ada-C9","id":35278806,"avatar_url":"https://avatars0.githubusercontent.com/u/35278806?v=4","gravatar_id":"","url":"https://api.github.com/users/Ada-C9","html_url":"https://github.com/Ada-C9","followers_url":"https://api.github.com/users/Ada-C9/followers","following_url":"https://api.github.com/users/Ada-C9/following{/other_user}","gists_url":"https://api.github.com/users/Ada-C9/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-C9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-C9/subscriptions","organizations_url":"https://api.github.com/users/Ada-C9/orgs","repos_url":"https://api.github.com/users/Ada-C9/repos","events_url":"https://api.github.com/users/Ada-C9/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-C9/received_events","type":"Organization","site_admin":false},"repo":{"id":119110633,"name":"Calculator","full_name":"Ada-C9/Calculator","owner":{"login":"Ada-C9","id":35278806,"avatar_url":"https://avatars0.githubusercontent.com/u/35278806?v=4","gravatar_id":"","url":"https://api.github.com/users/Ada-C9","html_url":"https://github.com/Ada-C9","followers_url":"https://api.github.com/users/Ada-C9/followers","following_url":"https://api.github.com/users/Ada-C9/following{/other_user}","gists_url":"https://api.github.com/users/Ada-C9/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-C9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-C9/subscriptions","organizations_url":"https://api.github.com/users/Ada-C9/orgs","repos_url":"https://api.github.com/users/Ada-C9/repos","events_url":"https://api.github.com/users/Ada-C9/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-C9/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Ada-C9/Calculator","description":"Calculator Exercise","fork":true,"url":"https://api.github.com/repos/Ada-C9/Calculator","forks_url":"https://api.github.com/repos/Ada-C9/Calculator/forks","keys_url":"https://api.github.com/repos/Ada-C9/Calculator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ada-C9/Calculator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ada-C9/Calculator/teams","hooks_url":"https://api.github.com/repos/Ada-C9/Calculator/hooks","issue_events_url":"https://api.github.com/repos/Ada-C9/Calculator/issues/events{/number}","events_url":"https://api.github.com/repos/Ada-C9/Calculator/events","assignees_url":"https://api.github.com/repos/Ada-C9/Calculator/assignees{/user}","branches_url":"https://api.github.com/repos/Ada-C9/Calculator/branches{/branch}","tags_url":"https://api.github.com/repos/Ada-C9/Calculator/tags","blobs_url":"https://api.github.com/repos/Ada-C9/Calculator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ada-C9/Calculator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ada-C9/Calculator/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ada-C9/Calculator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ada-C9/Calculator/statuses/{sha}","languages_url":"https://api.github.com/repos/Ada-C9/Calculator/languages","stargazers_url":"https://api.github.com/repos/Ada-C9/Calculator/stargazers","contributors_url":"https://api.github.com/repos/Ada-C9/Calculator/contributors","subscribers_url":"https://api.github.com/repos/Ada-C9/Calculator/subscribers","subscription_url":"https://api.github.com/repos/Ada-C9/Calculator/subscription","commits_url":"https://api.github.com/repos/Ada-C9/Calculator/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ada-C9/Calculator/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ada-C9/Calculator/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ada-C9/Calculator/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ada-C9/Calculator/contents/{+path}","compare_url":"https://api.github.com/repos/Ada-C9/Calculator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ada-C9/Calculator/merges","archive_url":"https://api.github.com/repos/Ada-C9/Calculator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ada-C9/Calculator/downloads","issues_url":"https://api.github.com/repos/Ada-C9/Calculator/issues{/number}","pulls_url":"https://api.github.com/repos/Ada-C9/Calculator/pulls{/number}","milestones_url":"https://api.github.com/repos/Ada-C9/Calculator/milestones{/number}","notifications_url":"https://api.github.com/repos/Ada-C9/Calculator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ada-C9/Calculator/labels{/name}","releases_url":"https://api.github.com/repos/Ada-C9/Calculator/releases{/id}","deployments_url":"https://api.github.com/repos/Ada-C9/Calculator/deployments","created_at":"2018-01-26T22:35:02Z","updated_at":"2018-02-10T22:10:32Z","pushed_at":"2018-02-11T01:22:15Z","git_url":"git://github.com/Ada-C9/Calculator.git","ssh_url":"git@github.com:Ada-C9/Calculator.git","clone_url":"https://github.com/Ada-C9/Calculator.git","svn_url":"https://github.com/Ada-C9/Calculator","homepage":"","size":14,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":50,"mirror_url":null,"archived":false,"open_issues_count":50,"license":null,"forks":50,"open_issues":50,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ada-C9/Calculator/pulls/18"},"html":{"href":"https://github.com/Ada-C9/Calculator/pull/18"},"issue":{"href":"https://api.github.com/repos/Ada-C9/Calculator/issues/18"},"comments":{"href":"https://api.github.com/repos/Ada-C9/Calculator/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/Ada-C9/Calculator/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/Ada-C9/Calculator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ada-C9/Calculator/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/Ada-C9/Calculator/statuses/ef52183860ab220740ee6c2ab12d3b30f2561a5f"}},"author_association":"NONE"}}
{"actor":{"display_login":"CheezItMan"}}