Skip to content

Conversation

@jazziesf
Copy link

@jazziesf jazziesf commented Aug 8, 2018

Calculator

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
Describe how you stored user input in your program? User input was stored in a variable and a method
How did you determine what operation to perform? I used an array to store all operators name and symbols. If the user input matched the operation it would continue to ask for the number to evaluate
Do you feel like you used consistent indentation throughout your code? one of the returns is off by a space bar or tab i noticed at the bottom
If you had more time, what would you have added to or changed about the program? I would have added a method that checks whether the input is a float or integer. Ask user if they wanted to calculate another equation or end their session. Created method that would call the equations without having based on the command the user decided rather than multiple methods for each operator.

@CheezItMan
Copy link

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. Check
Summary You hit all the learning goals. Well done. See my inline notes for detailed comments and ask me questions if you have any.

puts "Please input the numbers you want to calculate:"
print "Number:"
number = gets.chomp.to_f
while number =~ /\D/

Choose a reason for hiding this comment

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

This doesn't actually do anything because you've already converted the input to a float.

Also looking at reading in numbers from user input, this does not seem DRY. Maybe you should make 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