Skip to content

Conversation

@RebeccaRoach
Copy link

Assignment Submission: Calculator

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 thought my spacing and readability were deliberate, as well as descriptive variable names. Perhaps I could have condensed my methods.
How did your code keep track of user input? My code used gets.chomp to accept user input and stored it in a variable. A method called get_valid_num made sure the user entered a valid number for later calculation.
How did your code determine what operation to perform? From the user's specified operation, I used a case statement with four different operations to calculate the result.
What opportunities exist to create small methods for this project? Methods to validate input and start the calculator all over again are examples of methods I made for this project that were relatively compact. Methods for each of the math functions (addition, subtraction, etc) could also be possible.
In the next project, what would you change about your process? What would you keep doing? I would explore more of Ruby's in-built methods, as well as chaining methods - for example, to validate if input is some kind of number (whether int or float). I might also use Ruby's rescue function to alert about division by zero. I'll keep using methods to separate out functionality in my code.

@CheezItMan
Copy link

Calculator

Major Learning Goals/Code Review

Criteria 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 ✔️

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 ✔️

Code Style Bonus Awards

Was the code particularly impressive in code style for any of these reasons (or more...?)

Quality Yes?
Perfect Indentation ⚠ You are using 4-space indents. Instead use 2-space indents in the future. You can set the default in VS Code.
Elegant/Clever ✅, I like your custom methods here.
Descriptive/Readable
Concise
Logical/Organized

Summary

Nice work, you hit all the learning goals here. This is a good start here at Ada.

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