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

MoneyCollectingBooth's constructor, instantiate the ticketStack to a new stack.Then, instead of adding the five tickets to the Items list, push them onto the ticketStack using the Push method.
SellTicket method, instead of asking the attendant to find a ticket, just remove the first ticket off of the ticket stack using the Pop method.MoneyCollectingBooth constructor and in the SellTicket method after popping the ticket off the stack.ticketStack after the constructor breakpoint is hit.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).

BirthingRoom and Zoo classes as specified in the diagram below.The Queue class is in the System.Collections.Generic namespace.

PregnantAnimals in the birthing room constructor to a new queue.Zoo class's BirthAnimal method, remove the parameter from the method header.Zoo class's BirthAnimal method, get the first pregnant mother by calling Dequeue on the birthing room's PregnantAnimals queue.BirthAnimal method in the Zoo class with a try/catch that catches an InvalidOperationExcpetion and shows a message telling the user the zoo does not have any pregnant animals.Zoo's AddAnimal method, call Enqueue on the PregnantAnimals queue if the passed-in animal is pregnant and pass in the animal parameter.This code has the user selecting an individual animal to give birth and we don't want that anymore.
comoZoo's BirthAnimal method and then populate the list box.BirthAnimal button only works if the animal is initially added to the zoo when it is pregnant.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.
showDialog is true, add an if-statement checking if the selected animal is pregnant.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.

MoveBehaviorType Enum.MoveBehaviorFactory.ClimbBehavior's Move method that represent the structure of the algorithm for climbing.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
HoverBehavior's Move method that represent the structure of the algorithm for hovering.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.

Move method inClimbBehaviorHoverBehavior© 2026 Northcentral Technical College