-
Notifications
You must be signed in to change notification settings - Fork 49
Space - Jessica #39
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?
Space - Jessica #39
Conversation
CalculatorMajor Learning Goals/Code Review
Functional Requirements
Overall Feedback
Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
SummaryNice work, you hit the learning goals here. Well done. This makes a good start at Ada! |
1 similar comment
CalculatorMajor Learning Goals/Code Review
Functional Requirements
Overall Feedback
Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
SummaryNice work, you hit the learning goals here. Well done. This makes a good start at Ada! |
| end | ||
|
|
||
| # validate that user input is numeric | ||
| def validate_number(num) |
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.
I suggest moving your methods to the top of the file for now, later another file, and putting the main driver code below.
|
|
||
| # update operator to operation to use in user prompt | ||
| case operator | ||
| when "add", "+", "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.
The when should be indented under the case.
| formula += "#{num1} * " | ||
| end | ||
| puts "#{formula.chomp(" * ")} = #{num1.to_i ** num2.to_i}" | ||
| when "modulo" |
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.
You should also check for divide by 0 when using modulo.
Assignment Submission: Calculator
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions:
Reflection