-
Notifications
You must be signed in to change notification settings - Fork 51
Leaves - Bri #55
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
base: master
Are you sure you want to change the base?
Leaves - Bri #55
Conversation
CalculatorWhat We're Looking For
--- | --- |
| if string.length == 0 | ||
| return false | ||
| end | ||
| return string.scan(/\D/).empty? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a neat way to check if it's a number! If you found this out on the web, don't forget to cite your source!
| puts "Welcome to the Calculator program! I hear you need help..." | ||
| puts "Which operator would you like to use from the below list?" | ||
| 4.times do |i| | ||
| puts "#{i+1}: #{operators[i][0]} (#{operators[i][1]})" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice use of a loop
| # use case command to complete equation | ||
| case operator_pick | ||
| when "add", "+" | ||
| puts (num_one_pick + num_two_pick) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These puts should be indented further than the whens in this block!
Calculator
Congratulations! You're submitting your assignment.
Comprehension Questions