Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMichael Woodcock
3,094 PointsThe question is confusing
I have implemented all that is required of this challenge in Xcode and it runs great. I am not sure what exactly this is asking for.
Stone Preston
42,016 Pointsplease post teh code you have tried so far. cant help you without knowing what you are trying
Michael Woodcock
3,094 PointsI've tried the following:
float var1 = 22;
float var2 = 33;
addTwo(var1,var2);
and also:
float addTwo(var1, var2){ float sumVar = var1 + var2; return sumVar; }
1 Answer
Stone Preston
42,016 Pointsthe challenge asks for you to write a function called addTwo that takes two floats as arguments and returns the sum of the floats. it should look something like this:
float functionName(float floatOne, float floatTwo) {
return something;
}
now thats not the answer to the challenge, but it should help you out. you need to fill in the function name and also figure out what to return
Michael Woodcock
3,094 PointsThanks. I was defining the "floatOne", "floatTwo" outside the function.
Stone Preston
42,016 Pointsno problem. yeah all it wants is the function itself, you dont have to use it or anything, just implement it.
Stone Preston
42,016 PointsStone Preston
42,016 Pointsplease post the code you have tried