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 trialmrsands
Courses Plus Student 13,641 PointsLooking for help on this question.
I'm a bit confused on this question. If there's no current array, what is it supposed to be looping through? Even still, I'm not sure how to access these properties. Can someone help and potentially refer me to some materials to understand this better?
namespace Treehouse.CodeChallenges
{
class FrogStats
{
public static double GetAverageTongueLength(Frog[] frogs)
{
for(int i = 0; i < frogs.Length; i++)
{
}
}
}
}
namespace Treehouse.CodeChallenges
{
public class Frog
{
public int TongueLength { get; }
public Frog(int tongueLength)
{
TongueLength = tongueLength;
}
}
}
1 Answer
busongomwembe
30,682 Pointsnormally an array is populated with zeros if you dont put any value.eg if you define int [] numbers=new int [6]; all values will be veros by default.you can change the values by changig the index position.eg numbers[0]=4;
did i answer your If there's no current array, what is it supposed to be looping through? question.