help
Root Question Message
public Person(int initialAge)
{
// Add some more code to run some checks on initialAge
if (initialAge < 0)
{
Console.WriteLine("Age is not valid, setting age to 0.");
age = 0;
}
initialAge = age;
}
public void amIOld()
{
// Do some computations in here and print out the correct statement to the console
List<int> ages = new List<int>();
ages.Add(age);
foreach (int i in ages)
{
if (i < 13)
{
Console.WriteLine("You are young.");
}
else if (i >= 13 && i < 18)
{
Console.WriteLine("You are a teenager.");
}
else
{
Console.WriteLine("You are old.");
}
}
}
ages.Add(age)
_age
public int _age;