In BMITime, is (float) bmi needed?


#1

I noticed this as I was working out my solution to the challenge.

Is there a reason to create the (float) bmi here?

            // Call the bodyMassIndex method
            float bmi = [person bodyMassIndex];
            NSLog(@"person (%d, %.2f) has a BMI of %.2f", [person weightInKilos], [person heightInMeters], bmi);

when you could put the method into NSLog arguments?

        NSLog(@"person (%d, %.2f) has a BMI of %.2f", [person weightInKilos], [person heightInMeters], [person bodyMassIndex]);

#2

Yes, you can do it without the local variable. I just made it two steps because I thought it would be easier for beginners to understand.


#3

Yes, thank you for making this easy on beginners! It gives us confidence to try alternatives.