Open
Conversation
beccaelenzil
reviewed
Aug 9, 2019
beccaelenzil
left a comment
There was a problem hiding this comment.
Great work. You code is clear and you make good use of new concepts (case/when, methods). The user experience if quite refined. Furthermore, your responses to the reflection questions are thorough and thoughtful. See the code review for a few minor suggestions.
| oper = gets.chomp | ||
| end | ||
|
|
||
| # asks the user to enter two numbers, prints error if invalid input |
There was a problem hiding this comment.
You've written almost exactly the same code here twice, to get the first number and the second number. Could you DRY that up by putting this logic in a method or a loop?
| while num2_test.to_s != num2 | ||
| print "You entered an invalid number, please enter your second number again: " | ||
| num2 = gets.chomp | ||
| num2_test = num2.to_i |
There was a problem hiding this comment.
You noted this in your reflection, but you should convert to floats so that it handles float division correctly (5/6 should not equal 0)
CalculatorWhat We're Looking For
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Calculator
Congratulations! You're submitting your assignment.
Comprehension Questions