tags | language |
---|---|
arrays, beginner, methods |
objc |
- Fork the lab.
- Work with the person next to you, or people around you. No more than 3 to a group.
- When you are done submit a single pull-request for your team back to the main repo on flatiron-school-students
- Include in the pull-request description who you worked with!
- Celebrate!
- Write
rollCallDwarves:(NSArray *)dwarves
. This method should take in an NSArray of dwarves and returns a roll call sheet with their number. I'd recommend using a standardfor
loop for this. This is a roll call sheet for HUMANS so please start counting at 1. For example given the following array:
@[@"Doc",@"Dopey",@"Bashful"]
return an NSMutableString
that looks like this:
1. Doc | 2. Dopey | 3. Bashful
- Write the
summonCaptainPlanet:(NSArray *)planteerCalls
method. This method should take anNSArray
of forces. These forces a bit lackluster...let's give them some hart and make them all caps and an exclamation point after to show we really mean it! Return anotherNSArray
with a capitalized and exclamation point after. So for example the followingNSArray
:
@[@"earth",@"wind"]
would turn into:
@[@"EARTH!", @"WIND!"]
- Write the
longPlaneteerCalls:(NSArray *)planteerCalls
method. The planeteer calls are supposed to be short so let's find out if any of our calls have more than 4 characters. This method takes in a list of planteerCalls and returns the list of planeteer calls that have more then 4 characters. So for example the followingNSArray
:
@[@"earth",@"wind"]
would return:
@[@"earth"]
-
Write the
findTheCheese:(NSArrray *)cheeses
method. This method should look through theNSArray
ofNSString
s and find the first string that matches one of the following cheese strings:@"cheddar", @"gouda", or @"cambert"
. It should then return theNSString
of the resulting search. If it doesn't find anything, returnnil
. -
Write the
calculateDollarAmountsWithReceipt:(NSArray *)receipt
method. This method should keep help someone keep track of their money. Sadly...people keep their receipts in a weird way. They keep in them in anNSArray
that looks like this:
@[@"$$", @"$", @"$$$"]
So this method takes an array like that in, and should return another array converted to monetary values (As NSString
) So the previous NSArray
would turn into this:
@[@"$2",@"$1",@"$3"]