Skip to content

Conversation

@haydenwalls
Copy link

Calculator

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
Describe how you stored user input in your program? I took in user input via the gets.chomp method and assigned the data to three different variables
How did you determine what operation to perform? Asked the user which operation to perform; checked their input against an array of allowable options
Do you feel like you used consistent indentation throughout your code? Almost completely. Just realized that the parameters in my method signatures aren't surrounded by whitespace like the args were later on when the methods were actually called
If you had more time, what would you have added to or changed about the program? I would have loved to figure out how to both include support for user inputted floats while also barring erroneous, non-numeric input. Also wish I could have supported parentheticals but that seemed like a slog lol.

@tildeee
Copy link
Collaborator

tildeee commented Aug 12, 2018

Calculator

What We're Looking For

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

Hayden!!!! First I want to say!!!!! That the enthusiasm this calculator has!!!!! Is so funny and good to me!!!!! YEAH!! I felt so affirmed by the time I found out that 3 + 5 was 8.0

Anyway:

Good work on this project!

It works as expected and the code works as expected. The code looks good too. I would so overall, the code was clean, easy to read, and well-organized. I'm glad you practiced writing methods and doing interesting things with conditionals and loops.

One small thing that doesn't work with this calculator implementation is: The user can't put in negative numbers! This is a symptom of the regex you wrote only accepting digit characters, and not an optional hyphen.

I would get out of the habit of using system("clear")-- our projects at Ada will not have a requirement to clear the screen. system() is a powerful command that could affect more things that we'd like, so I'd get out of the habit of it now!

You mentioned in your comprehension questions that you didn't format some methods as you'd like, as you did def add(x, y) as opposed to def add( x, y ). In the future, you should know, I am less concerned with that! Do what makes sense, especially as the parameter list and names were short, it was easy to read def add(x, y).

That being said, I have no other comments -- overall good work!

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