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

Laura Robertson -- Carets #29

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

LauraAddams
Copy link

Calculator

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
Describe how you stored user input in your program. I stored user input as variables and calculations as variables. I then referenced them later in the method.
How did you determine what operation to perform? User input is a string. An if else block stores each operation by symbol (ex. +) and name (ex. add). When it finds the right match it does the proper calculation referencing the calculation variable.
How did you make sure your program behaved correctly? By giving the user the option of individual input (operator, num1, num2) I didn't start the method unless all answers would work. Rescue, retry repeats the question until a float or integer is entered. A while loop scans an array until it finds a matching operator.
Do you feel like you used consistent indentation throughout your code? For the most part, although after using the shortcut I see there can be a few improvements.
If you had more time, what would you have added to or changed about the program? I would create another method that can do parenthetical. My guess is to reference the original method and run it twice before moving to the parenthetical method.

@CheezItMan
Copy link

Calculator

What We're Looking For

Feature Feedback
Takes in two numbers and an operator and performs the mathematical operation. Check
Baseline
Readable code with consistent indentation. Check
Extras
Summary Just a note, it's modulus not module. Other than that there is a bug when the user enters 0 for a denominator. Also your calculator method too big. It's doing all the calculations in one method. It should be broken up into smaller, bite sized methods. Also I'd advise creating methods to do user into so you don't have to repeat your code as often.

# ******************

# Method for calculator
def calculator(operation, num1, num2)

Choose a reason for hiding this comment

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

This method could be broken up into 6 methods. It's trying to do too many things.

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