C# C# Objects Methods Methods

Ryan Wood
Ryan Wood
888 Points

I 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.

Frog.cs
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

Ryan Wood
Ryan Wood
888 Points

I 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!