Skip to content

Conversation

SelamawitA
Copy link

Calculator

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
Describe how you stored user input in your program?
I stored user input as a string .
How did you determine what operation to perform?
Prompted the user for their preference of an operation , if operation was not included in menu a default was selected.
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? I would have liked to played with the idea of using a case/switch statement in my code. It seems like an interesting way of checking user input. I would have also liked to tried to learn more about recursion to attempt the () probem.

@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.

You end up combining syntax for something that feels like an instance variable (because of the @) and a constant variable (because of the naming conventions and context) for @MAX_AMOUNT_OF_ATTEMPTS. I agree that it should be a constant, but you don't need the @.

Nice use of .round in the math section!

Specifically in printing the math for the exponent, you have a bug. I'm making a separate comment in the code about it

I think that your choice to have a limit on attempts is interesting. I think it's a good programming challenge, and I think it may or may not be frustrating for a user

Overall, great calculator; functions well and does exactly what we asked you to do :)

exponent_value.concat(" = #{num1**num2}")
else
exponent_value = "#{num2}^#{num1} = #{num2}"
(num2.to_i-1).times do
Copy link

Choose a reason for hiding this comment

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

I think this is supposed to use num1 instead of num2 here

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