Skip to content

Conversation

madaleines
Copy link

Calculator

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
Describe how you stored user input in your program? I used regular gets.chomp and later on in the case statement convert it to a float
How did you determine what operation to perform? defining each operation (add, subtract, etc)
Do you feel like you used consistent indentation throughout your code? yes...?
If you had more time, what would you have added to or changed about the program? Working out the float vs. integer portion. I wanted to perform a check for integer and do a case option under that and a case option for float if it were a float

@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

Good job with the calculator project overall! It has all the functionality that I expect

For your comprehension question answers, for question 2, I think a better way to say that would be that you defined a method for each operation

Just a little thing to think about for your code in the future to make your life easier... You end up writing the code num_one.to_f, num_two.to_f a lot. In order to avoid rewriting the .to_f part the whole time, it might be easier to have some code that was like

puts "\nWhat is the first number?"
input_one = gets.chomp
num_one = input_one.to_f

so you can just call num_one every time instead

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