Objective: To learn Objective-C well enough to do a late cs1 or early cs2 project in objective-c

Due: Feb 11th at 11:59pm


In this project you will write a program which will be a simplified version of software to run the card access doors in a building like the science building in objective-c. (note my comp152 students are doing a very similar lab  


Get the sample input file.

You will need to write at least two classes and a third file with a main function.

The first class will be called LockData and store data about whether a particular card has access to a series of locks.

LockData must store the following information (this will be private so you can represent this however you like:
you must also make the following method available:

(BOOL) checkDoorPermissions:(int)doorNumber

behavior: This method will take an integer from 0 to 7 representing one of 8 doors. It will return true if this card's owner (this object) should open the door numbered doorNumber. The method should return false otherwise. Of course you will need other methods like constructors and accessor methods, but just fill in those that you need.

Your second class must be called LockDataBase. It needs to:
  1. have a collection (either an Array or an ArrayList, your choice) of LockData objects. If you go with an array make sure you can handle at least 25 elements.
  2. have a method which will read from a file named lockDataBase.txt (note that when I grade I will add additional lines to the sample file I'm giving you with this assignment.
    1. After the user reads each line of the file into the program, make a LockData object out of the line and put it into your array.
  3. Call your method for reading from the file in your constructor for the LockDataBase class. You must provide a zero parameter constructor.
  4. Provide the following method as part of your LockDataBase class
      (BOOL) canOpenDoor:(int) cardNumber DoorIndex:( int) doorNumber
Finally write a class or function which will create the LockDataBase object, then allow a user to enter a card number and a door. The program should query the LockDataBase object and then tell the user if the door would open for this user or not.


Include a readme.txt text file in your project. For this project the readme.txt should include

When you are ready to submit your project zip up the folder with the objective-c code, your sample input file and your readme and upload them to moodle.