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

"Final Exam" -- updated Calculator. #2

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

Conversation

sophiagatliff
Copy link

Hey!

Doing this as a kind of "Final Exam" for the course. :)

I noticed that the Calculator was very buggy, and lacked a lot of features. So I went ahead and created most of them!

This should function pretty close to the main iOS calculator.

Things you can do now:

  • Can hit the same operator twice in a row to do the same operation again (like in iOS)
  • Can change operations if you hit the wrong button.
  • Can hit return twice in a row to do the same operation again (like in iOS).
  • App shouldn't crash at all! Pretty sure I figured out all possible crash cases.
  • If the number is an integer, it will appear as an integer in the display, not as a double (so 1, not 1.0).
  • General Quality of Life improvements (aka I did other stuff but forget what).

Basically you can just hit any button and it will do something useful and not crash!

The ONE situation where the app will crash is if you exceed the maximum integer number in the Setter. I tried an if statement to take care of that comparing Int(newValue) < Int.max... but Int(newValue) takes place BEFORE the comparison Int.max, so I was logically a bit stuck and figured it was fine for this project. :)

Also doing this pull request as part of the "exam". haha. :D

Would be cool if this was linked somewhere for other students to see!

@sophiagatliff sophiagatliff changed the title copy files "Final Exam" -- updated Calculator. May 30, 2020
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.

1 participant