Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Ampers) Leticia Tran - My Calculator #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

LetiTran
Copy link

@LetiTran LetiTran commented Feb 7, 2018

Calculator

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
Describe how you stored user input in your program? I stored the user inputs into separate separate variables
How did you determine what operation to perform? I used a case/when method that compares the string input on the "operation" variable that I prompt the user for in the beginning of the program.
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? I would add the optional enhancement of adding support for parenthetical operations.

@LetiTran LetiTran changed the title My Calculator Leticia Tran My Calculator Feb 7, 2018
@LetiTran LetiTran changed the title Leticia Tran My Calculator (Ampers) Leticia Tran - My Calculator Feb 7, 2018
…al to zero, instead of the two numbers being evaluated if it's equal or less than equal.
@CheezItMan
Copy link

CheezItMan commented Feb 10, 2018

Calculator

What We're Looking For

Feature Feedback
Takes in two numbers and an operator and performs the mathematical operation. Check
Readable code with consistent indentation. Looks pretty good
Summary Nice work, you hit all the requirements. You also handled modulus and exponent. Great job! I also like how you broke things into methods.

puts "\n"
print "Number 1: "
first_num = gets.chomp
while first_num.match?(/\D/) && !(first_num.match?(/\d\.\d/)) || first_num == ""

Choose a reason for hiding this comment

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

Nice work trapping user input until they get the put in an acceptable value.

However notice that you repeat this code... makes a good candidate for a method!

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