Skip to content

Conversation

mmlamkin
Copy link

@mmlamkin mmlamkin commented Feb 8, 2018

Calculator

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
Describe how you stored user input in your program?
How did you determine what operation to perform?
Do you feel like you used consistent indentation throughout your code?
If you had more time, what would you have added to or changed about the program?

@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

You need to answer the comprehension questions when you submit your project. You and I can get in touch to figure that out together.

Great job with the calculator, it functions very well. More than okay :)

You have a bug in your code about checking for valid operation. I'll be adding a comment on that :)

It seems that the choice for float or integer doesn't change the functionality of the calculator very much!

You ended up extending the class Object by defining the method is_number?, which is pretty brilliant. I think that adding methods onto Object can be very dangerous, but in this case it was very useful because Strings are Objects here. Pretty slick use of self and implicit return with the complex conditional.

Nicely done overall


until operations.include?(user_operation)
print "Please enter valid operation, remember-this calculator is only okay: "
user_operator = gets.chomp.downcase
Copy link

@tildeee tildeee Feb 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably want to assign this value to the variable user_operation instead of user_operator. If you put in an erroneous operation and get into this until loop, you end up never being able to escape, hehehe

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