Conversation
CalculatorWhat We're Looking For
Karis! Your project works as expected -- it does all the calculations. Good work on that! There are a few things that strike me as a little strange about your code--
def adding_format()
($answer =~ /[+]/ && $answer.length == 1) ...
endI'd prefer this: def adding_format( operation_input)
(operation_input=~ /[+]/ && operation_input.length == 1) ...
endThis allows variables to use local scope instead of global scope.
I think your approach to solve calculator isn't typical/isn't common -- which isn't a bad thing! But I wonder if you made it a little more complex for yourself than needed. When you feel like you're ready to look at this project with fresh eyes, I'd encourage you to ask a fellow classmate if they can walk you through their code, and maybe you can see how you two approached things the same way (you asked for input, verified it was in a format that you needed and was a correct operation, and then made a calculation based on that operator), but did different implementations. In general, the format of the code is good, and you got it to work, and I'm happy :) Let me know if you have any questions! |
Calculator
Congratulations! You're submitting your assignment.
Comprehension Questions