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 Loops and Final Touches Static Members

can someone get me started on this? I am completely lost

not sure how to start

RightTriangle.cs
namespace Treehouse.CodeChallenges
{
    class RightTriangle
    {

    }
}

1 Answer

Steven Parker
Steven Parker
230,970 Points

It might help to break the task down and do it in steps:

  • you'll generally start a method with public
  • the method name is CalculateHypotenuse
  • it is a static method
  • it returns a double
  • it takes two parameters
  • both parameters are double
  • the Pythagorean theorem is: hypotenuse = SquareRoot( side1 ^ 2 + side2 ^ 2 )
  • the actual name of the C# "square root" function is System.Math.Sqrt

I'll bet you can get it from here.

Chanuka Weerasinghe
Chanuka Weerasinghe
2,337 Points

Good answer.

I must say to the OP that its always a good practice to use the command line Mono to try your ways before entering the solution to treehouse work sheet.