Skip to content

Conversation

@anemonekey
Copy link

Calculator

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
Describe how you stored user input in your program. Normally I put gets.chomp in my main body of code. Thanks to methods, I could put the gets.chomp in a loop within the method to adjust the value in case of user error/silliness and return a valid value to a variable in my main body of code.
How did you determine what operation to perform? I made a hash of keys and values of ways the user could indicate their desired operation. I iterated through these values to find if the operation existed within the hash. If it did, I would initialize that operation.
How did you make sure your program behaved correctly? I tested it with every variation I could think of and made sure to pass the outlined tests.
Do you feel like you used consistent indentation throughout your code? For the most part, yes. When I used the auto-indent feature at the end, not many changes were made to my code.
If you had more time, what would you have added to or changed about the program? For small fixes, I would like to shorten code that is repetitive and unnecessary. Also, my parenthetical inputs only go for a single operator and cannot take expressions that are not in the format ( x #{operator} y ). On a larger scale, I want to change the program so it can take a longer, single statement from the user as input and calculate it.

@PilgrimMemoirs
Copy link

Calculator

What We're Looking For

Feature Feedback
Takes in two numbers and an operator and performs the mathematical operation. Well Done
Baseline
Readable code with consistent indentation. Well Done
Extras
Good job splitting functionality between multiple methods and maintaining DRY, readable code
Submission meets project expectations and learning goals. Nice Job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants