Created
September 8, 2014 03:23
-
-
Save HeidiHansen/32bf35f71452f3c26396 to your computer and use it in GitHub Desktop.
Nested Control Statements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)grow | |
{ | |
if (self.isFemale){ | |
if ([self.age integerValue] < 11){ | |
self.height = @([self.height floatValue] + [self randomFloatBetweenNumber:0 andNumber:1]); | |
} | |
else if ([self.age integerValue] >= 11 && [self.age integerValue] <= 15){ | |
self.height = @([self.height floatValue] + [self randomFloatBetweenNumber:.5 andNumber:2]); | |
} | |
} | |
else { | |
if ([self.age integerValue] < 12){ | |
self.height = @([self.height floatValue] + [self randomFloatBetweenNumber:0 andNumber:1]); | |
} | |
else if ([self.age integerValue] >= 12 && [self.age integerValue] <= 16){ | |
self.height = @([self.height floatValue] + [self randomFloatBetweenNumber:.5 andNumber:3.5]); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment