Skip to content
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

Add files via upload #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

canaanwest
Copy link

Calculator

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
Describe how you stored user input in your program. User input was stored as variables and then broken into arrays using the .split method
How did you determine what operation to perform? I used a series of "or" statements to make sure that a valid operation was present. Later in the program, I then used a series of if statements to determine which operation to perform. I had issues with my if/else loop later in the night and ended up making it a series of if statements (individual) rather than a large if/else statement. I am not sure why this difference in structure changed my program's functionality; based on what I know about how if statements work, it shouldn't have made a difference (especially because there was never more than one operation present in my program)
How did you make sure your program behaved correctly? I ran a series of tests on my program which made sure it handled each of the operations correctly. I also tested to make sure it had a consistent way to hand invalid input (like a non-integer or a 0-denominator), responding to the invalid input and alerting the user to the issue.
Do you feel like you used consistent indentation throughout your code? I think that while I was coding, it became really difficult to tell if my indentation was consistent, especially as I began nesting loops that I had already written inside of new loops. I did, however, use the cmd+alt+L shortcut, so my indentation should now be consistent.
If you had more time, what would you have added to or changed about the program? I got about halfway through the final step of the "extras" section--having the program handle parentheses--and I wish I could have finished that. I was using an approach of isolating the parenthesis, performing the math inside of them, and then replacing the entire segment of the string with a new, single number gotten from the math. I got to the point where I could have the program do the math, but I was unable to successfully replace the parenthetical with the new number. This part of my code isn't reflected in this upload--it is in another document if you'd like to see it, though.

end

if operation.include?(" ")
operation_modified = splitting(operation)
Copy link

Choose a reason for hiding this comment

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

the names operation and operation_modified is a little confusing to me since they represent the whole input expression so I didn't understand what it meant until I read through

@tildeee
Copy link

tildeee commented Aug 14, 2017

Good code! The small methods made it easy to read.

Nice use of our keyboard shortcut, too!

@tildeee
Copy link

tildeee commented Aug 14, 2017

Calculator

What We're Looking For

Feature Feedback
Takes in two numbers and an operator and performs the mathematical operation. x
Baseline
Readable code with consistent indentation. x
Extras

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