| tags | methods, arrays, iteration |
|---|---|
| languages | objc |
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,
takeANumberWithDeli:Name:, should accept the new person's name, the current line inNSMutableArrayformat, and return the updated line. Also, the method shouldNSLogtheir 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
nowServingWithDeli:. This method also should take aNSMutableArraydeliLine as an argument. This method should return the updatedNSMutableArraydeli Line andNSLogthe name of the next person in line after removing them from the line. If there is nobody in line, it shouldNSLogthat "There is nobody waiting to be served!" and return an emptyNSMutableArray -
Build a method
lineWithDeli:that returns people their current place in line (returned as an NSString). If there is nobody in line, it should return "The line is currently empty."