- Query extension methods return collections of anonymous objects with the requested information.
ZooExtensions class as specified in the diagram below.
GetYoungGuests, use LINQ syntax to return all guests who are 10 or younger. Return only the following propertiesAgereturn
from g in zoo.Guests
where g.Age <= 10
select new { g.Name, g.Age };GetFemaleDingos, use LINQ syntax to return all dingos who are female. Return only the following propertiesAgeGenderGetHeavyAnimals, use LINQ syntax to return all animals who are heavier than 200 pounds.Return only the following properties:
ForEach extension method.QueryHelper in the ConsoleHelper"getyoungguests", "getfemaledingos", and "getheavyanimals."Example: result = "Youngest Guests:\n"
ToList extention method to turn the collection into a List and then call the ForEach extension method to loop through the list and build up a string that can be output.Only animals who are heavier than 200 pounds should be shown, and only the selected properties should be shown. The result should look like the following:

Only dingos who are female should be shown, and only the selected properties should be shown. The result should look like the following:

Only guests who are 10 or younger should be shown, and only the selected properties should be shown. The result should look like the following:

ZooExtensions class as specified in the diagram below.
GetGuestsByAge, return all guests but order them by their age. Return only the following propertiesAgeGenderGetFlyingAnimals, return all animals that are flying. Return only the following propertiesGetAdoptedAnimals, return all guests that have an adopted animal. Return only the following propertiesShark chum = new Shark("Chum", 14, 377.3, Gender.Male);
this.AddAnimal(chum);
Squirrel chip = new Squirrel("Chip", 4, 1.0, Gender.Male);
this.AddAnimal(chip);
this.AddAnimal(new Squirrel("Dale", 4, 0.9, Gender.Male));
Guest greg = new Guest("Greg", 35, 100.0m, WalletColor.Crimson, Gender.Male, new Account());
Guest darla = new Guest("Darla", 7, 10.0m, WalletColor.Brown, Gender.Male, new Account());
greg.AdoptedAnimal = chip;
darla.AdoptedAnimal = chum;
this.AddGuest(greg, new Ticket(0m, 0, 0));
this.AddGuest(darla, new Ticket(0m, 0, 0));QueryHelper method on the ConsoleHelper class.They should be called "getguestsbyage", "getflyinganimals", "getadoptedanimals". Call each extension method in the appropriate case statement, and write the result to the console using the ForEach extension method.
All guests should be shown, but they should be sorted by age in ascending order. The resulting query should look like the following:

Only animals who are flying (e.g. eagles) should be shown. The resulting query should look like the following:

Greg and Darla should appear along with the animal they adopted. Greg should be the adopter and Chip should be the animal. Darla should be the adopter and Chum should be the animal. The resulting query should look like the following:

ZooExtensions class as specified in the diagram below.
GetTotalBalanceByWalletColor query that returns the values belowzoo.Guests statement.group g by g.Wallet.Color.ToString() into grKey.orderby gr.KeyKey (the wallet color) and the TotalMoneyBalance by using the Sum extension method on the grouping and passing in the Guest object with their Wallet's MoneyBalance.select new { gr.Key, TotalMoneyBalance = gr.Sum(g => g.Wallet.MoneyBalance) };GetAverageWeightByAnimalType, return all animals grouped and ordered by their types.Return only the following properties:
"totalbalancebycolor" and "averageweightbyanimaltype".Call each extension method in the appropriate case-statments, and write the results to the console.
Only the wallet colors that existing guests have should be shown. The wallet money balance for all guests with that color wallet should be totaled. The resulting query should look like the following:

Only the types of existing animals should be shown (one for each type, not one for each animal). The weight for all animals of that type should be averaged. The resulting query should look like the following:

ZooExtension class, methodsGetAdoptedAnimalsGetAverageWeightByAnimalTypeGetFemaleDingosGetFlyingAnimalsGetGuestsByAgeGetHeavyAnimalsGetTotalBalanceByWalletColorGetYoungGuests© 2026 Northcentral Technical College