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 trial

C# C# Objects Methods Methods

J o
J o
1,281 Points

I've been asked one of the task to create a method for Frog that will return true or false

I've been asked to create a method for Frog (one of the tasks) that will return true or false if the frog can or cannot reach the fly, I don't know what I've done wrong help?

Frog.cs
namespace Treehouse.CodeChallenges
{
    class Frog
    {
        public readonly int TongueLength;

        public Frog(int tongueLength)
        {
            TongueLength = tongueLength;
        }

        public bool EatFly(int distanceToFly)
        { 
            bool inBound = ToungueLength >= distanceToFly;

            return inBound;

        }
    }
}

2 Answers

Steven Parker
Steven Parker
230,995 Points

:point_right: You just have a little typo.

You spelled TongueLength with an extra "u" (you have "ToungueLength").

J o
J o
1,281 Points

Thank you Steven!