Skip to content

Conversation

torshimizu
Copy link

@torshimizu torshimizu commented Feb 7, 2018

the calculator project that has been completed.

Calculator

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
Describe how you stored user input in your program? Each user input was stored as a variable, variables that I would then manipulate depending on the type of input received.
How did you determine what operation to perform? If the user desired input was one of my possible operations, I could then go on to determine which operation the user wanted. My operations were listed in a hash of which the values were my operation names, and the values were an array of the possible allowed inputs that would select that operation.
Do you feel like you used consistent indentation throughout your code? Yes, and atom helped me indent as atom style would dictate
If you had more time, what would you have added to or changed about the program? If I had more time, I would try to have my program accept input that had parentheses - this would require me to reformat UI and change my program's control flow. I would also update my operation methods - I repeated myself by typing out the final output returned to the user for each operation, but I think I could get that to be one statement elsewhere in the program.

the calculator project that has been completed.
@tildeee
Copy link

tildeee commented Feb 12, 2018

Calculator

What We're Looking For

Feature Feedback
Takes in two numbers and an operator and performs the mathematical operation. x
Readable code with consistent indentation. x

Overall great calculator! It has all the functionality we expect.

You have a small bug in your program. If the first input for a number is invalid, it does not get reassigned to valid input.
To reproduce:

  • Start program
  • First number: "asdf"
  • Invalid input. Please enter a number: 2
  • Second number: 3
  • Operation: +
  • Observe: it says 0 + 3 = 3, expected 2 + 3 = 5

I think your approach to storing possible operations and checking for operations is really clever! I really like the possible_ops hash and it's one of my favorite ways to check operations.

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