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 Encapsulation and Arrays Arrays

Jan-Morten Reiners
Jan-Morten Reiners
1,236 Points

I Dont understand the Bummer message. I dont know what is my mistake

I hope anyone can help me

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

var finalLapTimes  = {2.2 , 2.3, lap3 , 2.8};
Jan-Morten Reiners
Jan-Morten Reiners
1,236 Points

i tried a different notaions but not one of these was correct.

var finalLapTimes = {2.2 , 2.3, "lap3" + 2.5 , 2.8};

...

4 Answers

Steven Parker
Steven Parker
231,268 Points

You have a few issues here.

I'm not sure if you're on task 3 or 4, but task 3 says to declare "another array of doubles", but you have just a "var" declaration. It also says to initialize the array "with the following times: 2.2, 2.3, 2.5, 2.8", but you have "lap3" as the third value.

Then task 4 says to "Set lap3 to the value in the third item of the finalLapTimes array". For this, you will create a new variable named "lap3" (you won't make any changes to the task 3 array). And initialize it using the correct value from the array.

Jan-Morten Reiners
Jan-Morten Reiners
1,236 Points

iam in Task 4. sorry Task 3 i have completed

Nikhil Korremula
Nikhil Korremula
3,615 Points

Declare and initialize another array of doubles named finalLapTimes with the following times: 2.2, 2.3, 2.5, 2.8. need solution