Branches - Eve: Calculator Assigmnent Submission#44
Branches - Eve: Calculator Assigmnent Submission#44tofuandeve wants to merge 1 commit intoAda-C12:masterfrom
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.
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.
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.
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.
Good decision on how to handle this!
Calculator
Congratulations! You're submitting your assignment.
Comprehension Questions