A pretty important deli needs somebody to program the "Take a Number" feature for their counter.
At the beginning of the day, the deli is empty and is represented by an empty array.
Example:
Write all of your code in FISAppDelegate.m
. All method signatures should be added to 'FISAppDelegate.h'.
-
Build a method that a new customer will use when entering the deli. The method,
takeANumberWithDeliLine:Name:
, should accept the current line inNSMutableArray
format, the new person's name, and return the updated line. Also, the method shouldNSLog
their position in line. And don't go being too programmer-y and give them their index. These are normal people. If they are 7th in line, tell them that. Don't get their hopes up by telling them they are number 6 in line. -
Build a method
nowServingWithDeliLine:
. This method also should take aNSMutableArray
deliLine as an argument. This method should return the updatedNSMutableArray
deli Line andNSLog
the name of the next person in line after removing them from the line. If there is nobody in line, it shouldNSLog
that "There is nobody waiting to be served!" and returnnil
-
Build a method
deliLine:
that takes anNSMutableArray
deliLine as an argument, and returns the current line (returned as an NSString). If there is nobody in line, it should return "The line is currently empty."
Make sure to read the tests before you get started to ensure you code your methods to their exact specifications!