cover picture cover picture


Final Exam

CMP 464: iOS Programming
Lehman College, City University of New York
Fall 2014


Objective

In this exam, you will create a calculator application.

The primary work to be done in this exam is to create a tab-based user-interface with two tabs: Calculator and Scientific Calculator.

  1. The first tab will allow the perform basic calculations like addition, subtraction, multiplication and division.

  2. The second tab will allow the user to perform all the same operations as the first tab, but will add the trigonometric functions sin x, cos x and tan x.

Required Tasks (100 points)

  1. The calculator will have buttons arranged in a standard layout with buttons for all the digits 0-9, buttons for +, -, ×, ÷, =, and C (for clear). The calculator will also have a field used to display the numbers being computed.

  2. The calculator should allow the user to make simple calculations. Examples:
    • 7 × 9 =
    • 37 ÷ 3 =
    • 522 - 275 =
    • 39 + 15 =
    • 10356 - 3463 =

  3. Pressing the C button will reset the calculator to initial state.

  4. In scientific mode, the calculator will display buttons for the trigonometric functions , sin x, cos x, tan x.

  5. The scientific calculator should allow the user to perform the same calculations that the standard calculator does in addtion to:
    • sin x
    • cos x
    • tan x

  6. Each calculator maintains its own state. Moving between the two tabs should not cause the user to lose their current computation.

Extra Credit (20 points)

  1. Provide the user with an option to view the history of the user's computations. Example:
    	         795 + 459 = 1254
    		 44 ÷ 11 = 4
    		 222 + 8 = 230
          
  2. When the user clears the calculator, the history should not be cleared. However, the history should record the fact the the calculator has been cleared.

  3. Each calculator maintains its own history.

  4. Navigation to the history view needs to be done through a push segue.

Please submit the completed final exam on Blackboard as a zip file of your entire project. No other forms of submission will be accepted.