cover picture cover picture


Midterm Exam

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


Objective

In this exam, you will create a dice game.

The primary work to be done in this exam is to create a tab-based user-interface with two tabs: 2-Dice Game, 4-Dice Game.

  1. The first tab will allow the user to roll up to 2 Dice.
  2. The second tab will allow the user to roll up to 4 Dice.

Required Tasks (100 points)

  1. Each die can be rolled individually if pressed, or they can all be rolled at the same time.

  2. Each tab should have a 'Roll All' button that will cause all the dice in the tab to be rolled.

  3. Rolling each die generates a random number (1-6) for the die. The resulting number must be displayed on each die.

  4. You will need to have a Dice class that keeps track of the state of each of your Dice.

  5. You will need to have a DiceGame class that manages the rolling of the dice.

  6. The DiceGame should keep a history of each roll. It will keep track of the total of all the dice in your tab after every roll. Please note that a die that has never been rolled should have a value of zero.

  7. You will also have a History view. This view will display all the totals from your game. You should be able to segue to/from the History view in both tabs.

  8. Each tab should also have a 'Reset' button that will reset your game and erase the History.

  9. You should use Auto Layout so your game can bee used in both Portrait as well as Landscape mode.

Extra Credit (10 points)

  1. Animate the rolling of the dice.

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