-
Notifications
You must be signed in to change notification settings - Fork 51
Branches - Eve: Calculator Assigmnent Submission #44
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?
Conversation
CalculatorWhat We're Looking For
Great work on this project, Eve! Your project submission is fantastic-- the code is extremely well-organized, logical, and readable. I can tell that a lot of thought went into how to organize and structure the code. Your methods are my favorite-- they are named as actions, they're descriptive and accurate, and they're meaningful. Your My only comments and suggestions are minor, because your logic and code style look great. We will go over some instructions on how to change your tab size to 2 spaces (rather than the default 4 spaces), but that's the only thing I want to call out right now. Overall, great work on this! |
| puts "#{count}. #{key}(#{value})" | ||
| count += 1 | ||
| end | ||
| end |
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.
Perfect! I really like how you separated this functionality of printing the options with a method.
| def get_a_number_from_user() | ||
| while true | ||
| input = gets.chomp | ||
| number = Float(input) rescue false |
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.
Fantastic solution! We'll get into details about rescue later in case you want to know more details about it, but this is a clever solution for this project
| while true | ||
| input = gets.chomp | ||
| number = Float(input) rescue false | ||
| if number |
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.
Great job on using logic that relies on number evaluating to a truthy value!
| return (operand1 / operand2) | ||
| when '^' | ||
| puts "Exponent can't be Float, your exponent was rounded down for this operation" | ||
| return (operand1 ** operand2.to_i) |
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.
Good decision on how to handle this!
Calculator
Congratulations! You're submitting your assignment.
Comprehension Questions