-
Notifications
You must be signed in to change notification settings - Fork 49
Space - Jeta #48
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 - Jeta #48
Conversation
Day 2 - Ada Homework - Calculator
This is my first draft and I upload my second one alredy.
Modify line nr 26
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. I like your methods, they work quite well. However you should work to properly indent code. |
| result = ((num_one.to_f) * (num_two.to_f)).round(2) | ||
| elsif math_operation == "Divide" || math_operation == "/" | ||
| result = ((num_one.to_f) / (num_two.to_f)).round(2) | ||
| end |
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.
indentation
| end | |
| end |
| def ValidOperator (math_operation) | ||
| until ["Add","+", "Subtract","-", "Multiply", "*", "Divide", "/"].include? math_operation | ||
| puts "Enter a valid selection" | ||
| math_operation = gets.chomp | ||
| end | ||
| return math_operation | ||
| end |
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.
indentation issues here.
| puts "Enter a valid number" | ||
| number = gets.chomp.to_i | ||
| end |
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.
More messy indentation.
| @@ -0,0 +1,56 @@ | |||
| #Add,Subtract,Multiply,Divide Methode | |||
| def operation(num_one, math_operation, num_two) | |||
| if math_operation == "Add" || math_operation == "+" | |||
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 capitalizing math_operation, before starting these if-elsif comparisons.
Assignment Submission: Calculator
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions:
Reflection