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 trialRyan Wood
888 PointsI am creating a parameter in my method but it is not being recognized and i'm not sure why.
I am supposed to create a method that takes in one parameter, distanceToFly, and see verify that the tongue can reach it. I feel like I am setting my parameters correctly but not sure how to correct it.
namespace Treehouse.CodeChallenges
{
class Frog
{
public readonly int TongueLength;
public Frog(int tongueLength)
{
TongueLength = tongueLength;
}
public bool EatFly(DistanceToFly distanceToFly)
{
bool eatable = distanceToFly.X > 0 && distancToFly.X < TongueLength.length;
return eatable;
}
}
}
1 Answer
Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 PointsYou're passing in a parameter of type DistanceToFly
, but it wants a parameter of type int
.
Ryan Wood
888 PointsRyan Wood
888 PointsI appreciate the help. I feel silly now but I was able to get it to compile and run after that an another small change. Thanks!