Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Materials 1. You will need to install the (free) program Xcode 8 using the App Store on your Mac (previous versions of Xcode will NOT

Materials
1. You will need to install the (free) program Xcode 8 using the App Store on your Mac (previous versions of Xcode will NOT work). It is highly recommended that you do this immediately so that if you have any problems getting Xcode to work, you have time to get help from Piazza and/or the TAs in their office hours.
2.
3. A link to the video of the lectures can be found in the same place you found this document.
Required Tasks
1. Get the Calculator working as demonstrated in lectures 1 and 2.
2.
3. Your Calculator already works with floating point numbers (e.g. if you touch 3 4 =, it will properly show 0.75), however, there is no way for the user to enter a floating point number directly. Fix this by allowing legal floating point numbers to be entered (e.g. "192.168.0.1" is not a legal floating point number!). You will need to have a "." button in your calculator. Don't worry too much about precision or significant digits in this assignment (doing so is Extra Credit).
4.
5. Add some more operations buttons to your calculator such that it has at least a dozen operations total (it can have even more if you like). You can choose whatever operations appeal to you. The buttons must arrange themselves nicely in portrait and landscape modes on all iPhone 6's and 7's.
6.
7. Use color to make your UI look nice. At the very least, your operations buttons must be a different color than your keypad buttons, but otherwise you can use color in whatever way you think looks nice.
8.
9. Add a Bool property to your CalculatorBrain called resultIsPending which returns whether there is a binary operation pending.
10.
11. Add a String property to your CalculatorBrain called description which returns a description of the sequence of operands and operations that led to the value returned by result (or the result so far if resultIsPending). The character = (the equals sign) should never appear in this description, nor should (ellipses).
12.
13. Implement a UILabel in your UI which shows the sequence of operands and operations that led to (or is leading to if resultIsPending) what is (or "will be" if resultIsPending) showing in the display. If resultIsPending is true, put . . . on the end of the UILabel, else put =. If the userIsInTheMiddleOfTyping, you can leave the UILabel showing whatever was there before the user started typing the number. Examples ...
1. touching 7 + would show "7 + " (with 7 still in the display)
2. 7 + 9 would show "7 + " (9 in the display)
3. 7 + 9 = would show "7 + 9 =" (16 in the display)
4. 7 + 9 = would show "(7 + 9) =" (4 in the display)
5. 7 + 9 = + 2 = would show "(7 + 9) + 2 =" (6 in the display)
6. 7 + 9 would show "7 + (9) " (3 in the display)
7. 7 + 9 = would show "7 + (9) =" (10 in the display)
8. 7 + 9 = + 6 = + 3 = would show "7 + 9 + 6 + 3 =" (25 in the display)
9. 7 + 9 = 6 + 3 = would show "6 + 3 =" (9 in the display)
10. 5 + 6 = 7 3 would show "5 + 6 =" (73 in the display)
11. 4 = would show "4 =" (12.5663706143592 in the display)
14.
15. Add a C button that clears everything (your display, the new UILabel you added above, any pending binary operations, etc.). Ideally, this should leave your Calculator in the same state it was in when you launched it.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Principles Of Database Systems With Internet And Java Applications

Authors: Greg Riccardi

1st Edition

020161247X, 978-0201612479

More Books

Students also viewed these Databases questions

Question

2. (1 point) Given AABC, tan A b b

Answered: 1 week ago