- The booth retrieves tickets from a stack instead of scanning the mixed item list.
The Stack class is in the System.Collections.Generic namespace.

Then, instead of adding the five tickets to the Items list, push them onto the ticketStack using the Push method.
Notice that the five tickets are in the stack in reverse order of how they were added. This is because stacks only allow pushing of items - pushing an item onto a stack puts it in the first spot.

Admit Ethel to the Zoo. Inspect the ticket after the SellTicket breakpoint is hit. Notice that its serial number is 5 - the serial number of the first item in the stack. This is because popping an item off of a stack (the only way to retrieve and remove an item from a stack) automatically returns the first item in the stack. This is called Last In First Out (LIFO).

The Queue class is in the System.Collections.Generic namespace.

This code has the user selecting an individual animal to give birth and we don't want that anymore.
In order to edit an animal to make it pregnant and added to the PregnantAnimals queue we must modify the double click event handler for animals.
Ensure that they are removed from the zoo and then added again. They will go to the bottom of the list and have a P next to their name now.


A baby dingo should be born since that was the second animal to be made pregnant.
A baby eagle should be born since that was the third animal to be made pregnant.

The climb behavior has three stages - climbing, falling and scurrying. In it, an animal climbs a vertical wall to a randomly set maximum height; when the animal hits the maximum point, it begins falling diagonally at a steep angle until it hits the bottom of the cage; when it hits the bottom, the animal scurries along the bottom of the cage until it hits a vertical wall; then the cycle starts again.
// if the animal is climbing
// make sure it's moving up (vertical direction)
// move vertically
// if the animal hit the maximum height (top of cage or other)
// switch to falling
// if the animal is falling
// move diagonally at a relatively steep angle
// if the animal hit the bottom of the cage
// switch to scurrying
// if the animal is scurrying
// move horizontally along the bottom of the cage
// if the animal hit a vertical edge
// set the random max height
// switch to climbing
The hover behavior has two stages - hovering and zooming. In it, an animal hovers by moving a single step in a random direction for five to eight steps. After the five to eight steps, the animal begins zooming by moving in a single random direction for seven to 10 steps. While zooming, the animal moves at four times its normal step distance.

© 2026 Northcentral Technical College