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: Alex #50

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

Ampers: Alex #50

wants to merge 2 commits into from

Conversation

brownav
Copy link

@brownav brownav commented Feb 8, 2018

Calculator

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
Describe how you stored user input in your program? Stored user input as variables.
How did you determine what operation to perform? Used case/when which emulates an if and or conditional.
Do you feel like you used consistent indentation throughout your code? Yes, I used the command + i shortcut we added on day 1 to double check - super helpful.
If you had more time, what would you have added to or changed about the program? I would have account for floats in division and perhaps added more operations.

@CheezItMan
Copy link

Calculator

What We're Looking For

Feature Feedback
Takes in two numbers and an operator and performs the mathematical operation. Check, it does addition, subtraction, multiplication, division
Baseline
Readable code with consistent indentation. Check, good work breaking things down into methods!
Overview You hit all the requirement, nice work!

end

def validate_num(num)
while num =~ /[[:alpha:]]/

Choose a reason for hiding this comment

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

This is only checking to see if the value is an alphabetic letter, so punctuation doesn't count.

print "Please enter a number (i.e. 1, 50, 100): "
num = gets.chomp
end
num = num.to_i

Choose a reason for hiding this comment

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

Also this means you can't handle decimal numbers, just an observation.

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