Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

C# C# Objects Encapsulation and Arrays Arrays

I don't understand why this line of code is failing?

I'm pretty sure this line of code for : Set the first double in the array to 2.2 is correct. I'm getting the error:" Bummer! Did you index into the first element?" but the first element IS set??

I googled the answer on another identical question and this is the correct code as far as I can tell? https://teamtreehouse.com/community/set-the-first-double-in-the-array-to-22

CodeChallenge.cs
double[] lapTimes = new double[4];
lapTime[0] = 2.2;

2 Answers

andren
andren
28,521 Points

You just have a small typo.

On the second line you have typed lapTime instead of lapTimes (you forgot the last s) if you add that like this:

double[] lapTimes = new double[4];
lapTimes[0] = 2.2;

Then your code will be accepted.

/facepalm

thank you