You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions:
Reflection
Question
Answer
What went well in your code style, such as indentation, spacing, variable names, readability, etc.? What was lacking?
I was able to divide all code into methods. Variables have meaningful names and the overall indentation looks good. The basic requirements are met. I was especially happy that I figured out how to use regex for user input validation (numbers, both Integers and Floats). As for opportunities, the code lacks comments (I ran out of time) and does not distinguish between Integers and Floats (I am converting user input to Float right away).
How did your code keep track of user input?
User input is being stored in three variables - one for operation type and two for numbers to do math on.
How did your code determine what operation to perform?
My code has a case statement which performs a corresponding math operation based on user input.
What opportunities exist to create small methods for this project?
The whole code is already split into methods, but it's possible to create even more granular ones - for example, a method for displaying the result of the calculation.
In the next project, what would you change about your process? What would you keep doing?
I will start commenting my code right away so that I won't end up with a working solution without a single comment line. I am also considering using git for version control.
yes/no, and optionally any details/lines of code to reference
Correctly uses conditionals (if/else/elsif)
✔️
Correctly uses loops (while/until)
✔️
Correctly uses gets.chomp
✔️
Correctly uses variables
✔️
Correctly creates and uses custom methods
Wow, great job breaking up the problem using custom methods!
Functional Requirements
Functional Requirement
yes/no
User can input two numbers and an operator and perform addition
✔️
User can input in two numbers and an operator and can perform subtraction
✔️
User gets feedback from the CLI when attempting to divide by zero, and the program does not give an error
✔️
Overall Feedback
Overall Feedback
Criteria
yes/no
Green (Meets/Exceeds Standards)
3+ in Code Review && 2+ in Functional Requirements
✔️
Yellow (Approaches Standards)
2 in Code Review && 2+ in Functional Requirements
Red (Not at Standard)
0,1 in Code Review or 0,1 in Functional Reqs, or assignment is breaking/doesn’t run with less than 5 minutes of debugging
Additional Feedback
Great work on this assignment. I've left a few comments for you to review. Overall, you did a great job breaking up the problem into subproblems using methods and gracefully handling invalid user input. It is clear that the learning goals for the project were met. Keep up the hard work!
Code Style Bonus Awards
Was the code particularly impressive in code style for any of these reasons (or more...?)
The reason will be displayed to describe this comment to others. Learn more.
Minor note: you should remove unused code from your finished project. Consider creating a file for yourself to store code logic that you'd like to save and might use in the future.
The reason will be displayed to describe this comment to others. Learn more.
Overall nice work handling division by 0. There's a very small bug introduced when you first try to divide by 0 as evidenced by this output. When you enter a new number, it still says 5.0 / 0.0 = ....
You can't devide by zero!
Enter a different number: ^[[A
Please, enter a valid number: 6.7
Here you go!
5.0 / 0.0 = 0.7462686567164178
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Assignment Submission: Calculator
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions:
Reflection