-
Notifications
You must be signed in to change notification settings - Fork 49
Time - Sharon #49
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
base: master
Are you sure you want to change the base?
Time - Sharon #49
Conversation
|
|
||
| # loop thru the operator hash in order to show user what the choices are | ||
| i = 1 | ||
| accepted_operation.each do |key, value| |
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.
clever use of a loop :)
| return user_input.to_f | ||
| end | ||
|
|
||
| # ask user for the first number and check if it's valid |
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.
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 loop?
| i += 1 | ||
| end | ||
|
|
||
| # ask user for a math operation |
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.
Consider putting the operation validation logic into it's own custom method.
CalculatorMajor Learning Goals/Code Review
Functional Requirements
Overall Feedback
Additional FeedbackGreat work on this assignment! You have gracefully and cleverly handled invalid user input. I left a few comments for you to review, but it is clear that the learning goals for this project. Keep up the hard work! Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
|
Assignment Submission: Calculator
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions:
Reflection