- A dictionary maps animal types to cages.
Zoo and Cage classes as specified in the diagram below.
ToString method, instead of using the AnimalType, get the name of the type of the first item in the list of caged items.Zoo constructor that adds cages to the Zoo, enter the following for the Add methodConvertAnimalTypeToType (this is the dictionary entry's key)FindCage method, instead of looping through the cages list, use the dictionary's TryGetValue method.Pass the animalType in, and get a Cage result out.
Cage result = null;
this.cages.TryGetValue(animalType, out result);
return result;AddAnimal and RemoveAnimal methods, use bracket notation on the cage dictionary to get the correct cage based on the animal's type.Then either add or remove the animal from the cage in addition to the zoo.

Zoo constructor that populates the animals list with the code below.This ensures that the animals are also getting added to their cages.
this.AddAnimal(new Chimpanzee("Bobo", 10, 128.2, Gender.Male));
this.AddAnimal(new Chimpanzee("Bubbles", 3, 103.8, Gender.Female));
this.AddAnimal(new Dingo("Spot", 5, 41.3, Gender.Male));
this.AddAnimal(new Dingo("Maggie", 6, 37.2, Gender.Female));
this.AddAnimal(new Dingo("Toby", 0, 15.0, Gender.Male));
this.AddAnimal(new Eagle("Ari", 12, 10.1, Gender.Female));
this.AddAnimal(new Hummingbird("Buzz", 2, 0.02, Gender.Male));
this.AddAnimal(new Hummingbird("Bitsy", 1, 0.03, Gender.Female));
this.AddAnimal(new Kangaroo("Kanga", 8, 72.0, Gender.Female));
this.AddAnimal(new Kangaroo("Roo", 0, 23.9, Gender.Male));
this.AddAnimal(new Kangaroo("Jake", 9, 153.5, Gender.Male));
this.AddAnimal(new Ostrich("Stretch", 26, 231.7, Gender.Male));
this.AddAnimal(new Ostrich("Speedy", 30, 213.0, Gender.Female));
this.AddAnimal(new Platypus("Patti", 13, 4.4, Gender.Female));
this.AddAnimal(new Platypus("Bill", 11, 4.9, Gender.Male));
this.AddAnimal(new Platypus("Ted", 0, 1.1, Gender.Male));
this.AddAnimal(new Shark("Bruce", 19, 810.6, Gender.Female));
this.AddAnimal(new Shark("Anchor", 17, 458.0, Gender.Male));
this.AddAnimal(new Shark("Chum", 14, 377.3, Gender.Male));
this.AddAnimal(new Squirrel("Chip", 4, 1.0, Gender.Male));
this.AddAnimal(new Squirrel("Dale", 4, 0.9, Gender.Male));FindCage method on the line that calls TryGetValue.Chimpanzee and click 'Show cage'Chimpanzee and the Value should be the Chimpanzee cage.
Cage object.Chimpanzee cage should show with 2 chimps in it.MainWindow add a new Chimpanzee. Ensure it is shown in the cage window.MainWindow remove a Chimpanzee.Ensure it is removed in the cage window.
ListUtil class in the Utilities project as specified in the diagram below.Add the code below to the Flatten method.

string result = null;
foreach (object s in list)
{
result += result == null ? s : separator + s;
}
return result;Add methods to the ConsoleHelper and ConsoleUtil classes as specified in the diagram below.The sequence diagram below will be how we will be using these methods.


"help" command in the Program.cscommandWords length is 2, call the ConsoleHelper's ShowHelpDetail method.commandWords array as an argument (e.g. "show" or "add")commandWords length is not 2, write a message to the console saying that there were too many parameters entered.ShowHelpDetail method.Dictionary<string, string> variable called arguments.Dictionary<string, string>.Add a key-value pair to the dictionary for each of the command parameters (objectType and objectName) - the key is the parameter name and the value is the parameter description. Then call the WriteHelpDetail method. Pass in the command parameter, a short description of the command (show or remove), and the arguments variable.

WriteHelpDetail method.upperCommand and store the command parameter as all upper-case using the ToUpper method in it.upperCommand and overview to the console on separate lines.The result should look like the example below:
Command name: SHOW
Overview: Show details of an object.Use the Flatten method on the ListUtil class to write out the keys of the arguments dictionary. Pass in a space as the separator. The resulting line written to the console should look like the example below:
Usage: SHOW objectType objectName"Parameters:".Then, loop through the arguments' KeyValuePairs and write out each key (which is the parameter name) and value (which is the explanation of the parameter).
foreach (KeyValuePair<string, string> kvp in arguments)
{
// code here
}"help show" command. The output should look like the image below.
"help remove" command. The output should look like the image below.
WriteHelpDetail method as specified in the diagram below.
WriteHelpDetail method, instantiate a new Dictionary<string, string> add a key-value pair where the argument parameter is the key and the argumentUsage parameter is the value.Then call the original version of the WriteHelpDetail method. Pass the command parameter, the overview parameter and the local dictionary.
ShowHelpDetail method, add cases to the switch statement for the "temp" and "add" commands.In each case statement, call the four-parameter WriteHelpDetail method. Pass in the command name, a short description of the command, the name of the parameter, and a description of the parameter.
"help add" command.The details of the add command, including an overview and parameter information, should be written to the console. The output should look like the image below.

"help temp" command.The details of the temp command, including an overview and parameter information, should be written to the console. The output should look like the image below.

WriteHelpDetail method and a regular ShowHelp method as specified in the diagram below.
WriteHelpDetail method, call the three-parameter WriteHelpDetail method.Pass in the command parameter, the overview parameter, and null. Passing in null for the arguments parameter signifies that the command has no arguments.
WriteHelpDetail method, check that the arguments parameter is not null before using it.ShowHelpDetail method, add cases to the switch statement for the "restart" and "exit" commands.In each case statement, call the two-parameter WriteHelpDetail method. Pass in the command name and a short description of the command.
"help" case in the Main method of the Program class, add a condition checking if the length of the commandWords array is 1.If so, call the ShowHelp method.
ShowHelp method.WriteHelpDetail method, which will write the information for the help command.Pass in the command name ("help"), a description of the command, the name of the (optional) parameter ("[command]"), and a description of the optional parameter.
Use the descriptions from the previous help command.
"help" command.Details of the help command and a list of all available commands should be written to the console. The output should look like the image below.

"help restart" command.Only the details of the restart command should be shown and there should be no information listed about parameters. The output should look like the image below.

"help exit" command.Only the details of the exit command should be shown and there should be no information listed about parameters. The output should look like the image below.

© 2026 Northcentral Technical College