Skip to content

Branches - Kristy #27

Open
kristyh32 wants to merge 1 commit into
Ada-C12:masterfrom
kristyh32:master
Open

Branches - Kristy #27
kristyh32 wants to merge 1 commit into
Ada-C12:masterfrom
kristyh32:master

Conversation

@kristyh32

Copy link
Copy Markdown

Calculator

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
What went well in your code style, such as indentation, spacing, variable names, readability, etc.? What was lacking? I feel like my indentation, spacing, variable names and readability were good. I feel like a lot of what I did could have been simplified if I had more time.
How did your code keep track of user input? My code kept track of user input with the variables operator, num1, and num2.
How did your code determine what operation to perform? My code used a case when conditional to decide what to do with the values num1 and num2 based on the operator selected. It also used a method for division that included a funny phrase when trying to divide by zero.
What opportunities exist to create small methods for this project? I feel like the case, when conditional could have been simplified with a method that would have worked for all of the math problems.
In the next project, what would you change about your process? What would you keep doing? Next time I will check in with other students more to see how they solved the problem to get more creative ideas about how to solve the problem and dry my code.

@tildeee

tildeee commented Aug 9, 2019

Copy link
Copy Markdown
Collaborator

Calculator

What We're Looking For

Feature Feedback
Readable code with consistent indentation x
Practices using variables appropriately x
Practices using conditionals appropriately x
If any, practices iteration appropriately x
If any, practices using custom methods appropriately x
Takes in two numbers and an operator and can perform addition x
Takes in two numbers and an operator and can perform subtraction there's a bug!
The program handles divide when attempting to divide by zero x

Well done on this project, Kristy! Your code is logical, well-organized, and readable. You did a GREAT job on the methods that you pulled out!

You accidentally have two bugs 😂 When doing the calculation, you do addition sometimes when you shouldn't. There are some comments, along with a few other minor suggestions on how to improve the code too.

Overall, great work on this project!

Comment thread calculator.rb
else
puts "You can't really divide numbers by 0... Awkward.."
end
end

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nicely done pulling this into a method!

Comment thread calculator.rb
end
end

def check_num

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is a minor suggestion, but: Instead of the name check_num, there may be a better name for this. What is this method responsible for? Since it's responsible for getting user input until it's valid, I may call it get_valid_user_input, but there are definitely a lot of other options that are good too.

Comment thread calculator.rb
puts "#{num1} #{operator} #{num2}: #{value}"
when "subtract", "-"
operator = "-"
value = num1 + num2

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Oh no! This is subtract, but you accidentally copy/pasted and left it as + 😂

Comment thread calculator.rb
puts "#{num1} #{operator} #{num2}: #{value}"
when "multiply", "*"
operator = "/"
value = num1 + num2

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same as above-- seems like you have some copy/paste errors. operator should be *, and value = num1 * num2

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