Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions TestAssessment/TestViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@

@interface TestViewController : ViewController

- (NSInteger *)shouldReturnAPositiveNSInteger;


@end
167 changes: 2 additions & 165 deletions TestAssessment/TestViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,179 +12,16 @@


@implementation TestViewController

NSInteger *_shouldReturnAPositiveNSInteger;

/*
This method should return any positive NSInteger
(hint: cannot be 0)
*/
- (void)shouldReturnAPositiveNSInteger {

}

/*
This method should return any negative CGFloat
(hint: cannot be 0)
*/
- (void)shouldReturnANegativeCGFloat {

}

/*
This method should return a falsy boolean
Falsey: Something which evaluates to FALSE.
*/
- (void)shouldReturnAFalseyBool {

}

/*
This method should return a single char from a - z
*/
- (void)shouldReturnACharAtoZ {
}

/*
This method should return the sum of all numbers from
0 - 99 using a loop (. 1 + 2 + 3 + ... + 98 + 99)
*/
- (NSInteger)shouldReturnSumOf0To100 {
return 0;
}

/*
Given a c array (int[]) and a count, return the sum of the numbers within the arr
(eg. arr[0] + arr[1] ...)
*/
- (NSInteger)shouldReturnSumOfArrayValues:(int *)arr withSize:(int)count {
return 0;
}

/*
Provided a C string (array of chars), return the character
that immediately preceeds the letter q
(ex. "aionkljajvqlkjaml" would return the letter 'v')
(hint: while loop)
*/
- (char)shouldReturnCharBeforeQ:(char *)str {
return '\0';
}

/*
This method should return the sum of aNumber + bNumber
*/
- (NSInteger)sumOfAnInteger:(NSInteger)aNumber andAnotherInteger:(NSInteger)bNumber {
-(NSInteger)shouldReturnAPositiveNSInteger {
return 0;
}


/*
This method should return a YES if aNumber is odd
*/
- (BOOL)isOdd:(NSInteger)aNumber {
return NO;
}

/*
This method should return YES if aNumber is a multiple of 5
*/
- (BOOL)isMultipleOfFive:(NSInteger)aNumber {
return NO;
}

/*
This method should return YES is aNumber is odd and bNumber is even
*/
- (BOOL)returnYesIfThisNumberIsOdd:(NSInteger)aNumber
andThisNumberIsEven:(NSInteger)bNumber {
return NO;
}

/*
This method should return the name property of the person
parameter (hint: command + click on class name to jump to the interface.
*/
- (NSString *)shouldReturnPersonsName:(Person *)person {
return @"";
}

/*
This method should change the person name to "Ada Lovelace"
*/
- (void)changePersonsNameToAdaLovelace:(Person *)person {

}

/*
This method should do the following:
1) Create an instance of Person
2) Set the person's name to "Santa Clause"
3) Set the person's age to 1823
*/
- (Person *)createAndReturnPersonWithSomeProperties {
return [[Person alloc] init];
}

/*
This method provides you an instance of Chair as a parameter
1) Create an instance of Person
2) Tell the person to sit in the chair
(hint: take a look at the methods on the Person class)

*/
- (void)makePersonSitInChair:(Chair *)chair {

}

/*
This method provides you an instance of Person as a parameter
Send a message to this Person object telling it to stand up
*/
- (void)makePersonStandUp:(Person *)person {

}

/*
Create and return an NSArray containing 6 NSString objects
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/
*/
- (NSArray *)createAndReturnNSArray {
return [[NSArray alloc] init];
}

// BONUS
/*
Update the array item at index 4 to be the name of the person passed
as a parameter
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSMutableArray_Class/
*/
- (void)changeValueOfIndexFourInArray:(NSMutableArray *)arr
toPersonsName:(Person *)person {

}

// BONUS
/*
Given a string, return the string repeated x times
Example: mike, 5 => mikemikemikemikemike
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSMutableString_Class/
*/

- (NSString *)repeatString:(NSString *)str
numberOfTimes:(NSInteger)x {
return @"";
}

// BONUS
/*
Given an array of numbers, sum each number in the array UNTIL
the sum is greater than 1050. The returned value of this method
should never be greater than 1050.
(ex: [500, 500, 500] returns 1000)
(ex: [200, 500, 100, 400] returns 800)
*/
- (int)returnSumWhileSumIsLessThan1050:(int *)arr {
return 0;
}

@end