public static int totalNumberOfPets;
public static int sumOfAllPetAges;
public static int petsOwned;
public static int youngest;
public static int oldest;
this.name = Console.ReadLine();
this.age = int.Parse(Console.ReadLine());
this.breed = Console.ReadLine();
public void setYoungest()
if (getAge() >= this.age)
Console.WriteLine(this.name + " is the youngest.");
if (getAge() >= this.age)
Console.WriteLine(this.name + " is the oldest.");
public static void setPetsOwned()
Console.WriteLine("How many pets do you own?");
petsOwned = int.Parse(Console.ReadLine());
Console.WriteLine("What is your pet's name?");
Console.WriteLine("How old is your pet?");
Console.WriteLine("What is the breed of your pet?");
Pet.sumOfAllPetAges += getAge();
Console.WriteLine("OK, so far you have entered the details for " + Pet.totalNumberOfPets + " pets and the combined total of all their ages is " + Pet.sumOfAllPetAges + ".");
public void printPetInfo()
Console.WriteLine(this.name + " is a " + this.breed + " and is " + this.age + ".");
public static double calculateAverageAge()
return (double) Pet.sumOfAllPetAges / (double) Pet.totalNumberOfPets;
public static void printAverageAge()
Console.WriteLine("The average age is " + Pet.calculateAverageAge());
Pet[] myPet = new Pet[Pet.petsOwned];
for (int i=0; i<Pet.petsOwned; i++)
Console.WriteLine("-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-");
for (int i=0; i<Pet.petsOwned; i++)