Skip to content

Create calculator.rb#29

Open
botrethewey wants to merge 2 commits intoAda-C7:masterfrom
botrethewey:master
Open

Create calculator.rb#29
botrethewey wants to merge 2 commits intoAda-C7:masterfrom
botrethewey:master

Conversation

@botrethewey
Copy link

Calculator

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
Describe how you stored user input in your program? This program takes 3 inputs from the user. The first being the operand, which is store in a variable, and the last two being the numerical values being manipulated by the operand, which are stored in an array.
How did you determine what operation to perform? I created an array of strings containing all of the words/symbols for allowed operands, then used an until loop to check if the user input is included in the operand array.
Do you feel like you used consistent indentation throughout your code? Yes
If you had more time, what would you have added to or changed about the program? I would like to add the parens option as well as give the user an option to use the calculator again for a new calculation.

@kariabancroft
Copy link

Calculator

What We're Looking For

Feature Feedback
Takes in two numbers and an operator and performs the mathematical operation. Yep! Nice job using the case statement
Baseline
Readable code with consistent indentation. Code structure looks good; indentation, comments and whitespace are appropriately used
Extras
Nice job using methods for your operations
Nice job with the number validation logic. I like the way you've used a while loop. I think you could simplify the nested if statements in there to remove some of the nesting (lines 40-51)
Nice job validating the operation using the array and include?

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