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 trialEddie Aguilar
2,393 PointsNot to sure why it won't pass. It worked fine in Xcode and Im pretty sure I followed all of the rules. help?
Please explain to me why it will not pass in Treehouse but will in Xcode
// Enter your code below
func getRemainder(value: Int, divisor: Int) -> Int {
let finalAnswer = value % divisor
return finalAnswer
}
1 Answer
Jonathan Ruiz
2,998 PointsHi Eddie for this problem one thing that isn't letting you pass is the external names for the parameters. For functions with parameters the external name is what is read when you call a function. And a local name is what is used inside the body of the function, the internal name doesn't show up when the function is called. In your code above you don't have the external names the problem wanted.
func nameExample(for example: Int) {
// in this function for is the external name that is read when you call the function.
// example is the local name and what you refer to inside the function
}
For the second part of the problem make sure to create a constant they will give you a constant name. Hope this helps ! you got the idea of the function right and the task, its just important to know the logic of external and local names for parameters.
Brian Blanco
12,281 PointsBrian Blanco
12,281 PointsHey Eddie,
So for this one it just seems like your missing the local parameter names.