-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Pipes - Nkiru- Calculator.rb #44
base: master
Are you sure you want to change the base?
Conversation
CalculatorWhat We're Looking For
Great work overall! |
if num.include?(".") | ||
return num = Float(num) | ||
else | ||
return num = Integer(num) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Watch your spacing here - the else
should be at the same level as the if
above, and the return
on line 50 should be indented more. When in doubt, use Atom's auto-indent.
|
||
# Methods for computing math operations | ||
def add(num_1, num_2) | ||
result = num_1 + num_2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that each of these is its own method. It makes it easy to find where in the code a certain operation occurs, and means that if you need to add a long complex operation (think finding the least common multiple of 2 numbers) the pattern will still work.
Calculator
Congratulations! You're submitting your assignment.
Comprehension Questions