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

michael edmondson
michael edmondson
4,511 Points

Parameter

Hey i clearly have the Parameters there i know im looking over something small can someone tell me what it is?

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

        public Frog(int tongueLength)
        {
            TongueLength = tongueLength;
            }
          public bool EatFly( int distanceToFly)
            {
              bool reachTongue = distanceToFly
              return reachTongue; 
        }
    }
}

1 Answer

You receive: Bummer: Did you create a parameter in your method named distanceToFly? because of the space before int for your parameter for EatFly. Remove that space.

As far as what EatFly returns you will need to consider if the distance to the fly is less than or equal to the frog's tongue length.