In this activity, you will start from the provided Zoo 1.1 LastName project and complete the first version of the Como Zoo object model.
The manager of Como Zoo has asked for the first version of a program that stores basic zoo information. This version will create the main Como Zoo object and connect it to the first objects the zoo needs to track: a featured animal, restrooms, a ticket booth, and the employee working at the booth.
This checkpoint gives the rest of the project a foundation. Later checkpoints will build on these objects and add more behavior.
ComoZoo object.




ZooScenario/MainWindow.xaml and double-click New Como Zoo.newComoZooButton_Click in MainWindow.xaml.cs.F5 to start the application, then click New Como Zoo. Confirm execution pauses in that handler.F5 to continue. Stop debugging, then select Debug > Delete All Breakpoints.New Como Zoo. Confirm the handler no longer pauses.// Create an instance of the Zoo class.
this.ComoZoo = new Zoo();

MainWindow.xaml.cs, set a breakpoint on this.ComoZoo = new Zoo(); inside newComoZooButton_Click.F5 and click New Como Zoo. Open Debug > Windows > Watch > Watch 1.this.ComoZoo to Watch. Before the highlighted statement runs, confirm null.F10 once. Confirm this.ComoZoo now expands as a Zoo object.F5 to continue. Stop debugging and remove the breakpoint before the next check.// Assign field values of Como Zoo.
this.ComoZoo.Capacity = 1000;
this.ComoZoo.Capacity = 1000; in newComoZooButton_Click.F5 and click New Como Zoo. Add this.ComoZoo.Capacity to Watch.this.ComoZoo.Capacity is 0.F10 once to execute the assignment.this.ComoZoo.Capacity is 1000.F5 to continue. Stop debugging and remove the breakpoint before the next check.this.ComoZoo = new Zoo(); so that line is temporarily commented outthis.ComoZoo.Capacity = 1000; in ZooScenario/MainWindow.xaml.csNew Como Zoo buttonthis.ComoZoo and confirm that it is nullZoo object that was never createdthis.ComoZoo = new Zoo();// Create the featured animal.
this.ComoZoo.FeaturedAnimal = new Animal();this.ComoZoo.FeaturedAnimal = new Animal();.F5 and click New Como Zoo. Add this.ComoZoo.FeaturedAnimal to Watch.this.ComoZoo.FeaturedAnimal is null.F10 once. Confirm the reference now expands as an Animal object.F5 to continue. Stop debugging and remove the breakpoint before the next check.// Create the restrooms.
this.ComoZoo.LadiesRoom = new Restroom();
this.ComoZoo.MensRoom = new Restroom();
// Assign the remaining field value of Como Zoo.
// You may place this beside Capacity to group Zoo field values.
this.ComoZoo.Name = "Como Zoo";
// Create the ticket booth.
this.ComoZoo.TicketBooth = new Booth();newComoZooButton_Click. Start and click New Como Zoo.F10 to execute each assignment once. Watch the corresponding reference change from null to its object.this.ComoZoo.LadiesRoom and this.ComoZoo.MensRoom each expand as a Restroom object.this.ComoZoo.TicketBooth expands as a Booth object.this.ComoZoo.Name is "Como Zoo".F5 to continue. Stop debugging and remove the breakpoint before the next check.// Assign field values of the featured animal.
this.ComoZoo.FeaturedAnimal.Age = 4;
this.ComoZoo.FeaturedAnimal.Sex = "Female";
this.ComoZoo.FeaturedAnimal.IsPregnant = true;
this.ComoZoo.FeaturedAnimal.Name = "Dolly";
this.ComoZoo.FeaturedAnimal.Type = "Dingo";
this.ComoZoo.FeaturedAnimal.Weight = 35.3;New Como Zoo.F10 to execute the featured-animal assignments, then inspect these full paths in Watch.this.ComoZoo.FeaturedAnimal.Name is "Dolly".this.ComoZoo.FeaturedAnimal.Type is "Dingo".this.ComoZoo.FeaturedAnimal.Sex is "Female".this.ComoZoo.FeaturedAnimal.Age is 4.this.ComoZoo.FeaturedAnimal.IsPregnant is true.this.ComoZoo.FeaturedAnimal.Weight is 35.3.F5 to continue. Stop debugging and remove the breakpoint before the next check.// Assign field values of the ladies' restroom.
this.ComoZoo.LadiesRoom.Capacity = 4;
this.ComoZoo.LadiesRoom.Sex = "Female";
// Assign field values of the men's restroom.
this.ComoZoo.MensRoom.Capacity = 4;
this.ComoZoo.MensRoom.Sex = "Male";
// Create and assign field values of the ticket booth.
this.ComoZoo.TicketBooth.Attendant = new Employee();
this.ComoZoo.TicketBooth.TicketPrice = 15.00m;New Como Zoo.F10.this.ComoZoo.LadiesRoom.Capacity is 4.this.ComoZoo.LadiesRoom.Sex is "Female".this.ComoZoo.MensRoom.Capacity is 4.this.ComoZoo.MensRoom.Sex is "Male".this.ComoZoo.TicketBooth.TicketPrice is 15.00m.this.ComoZoo.TicketBooth.Attendant expands as an Employee object.F5 to continue. Stop debugging and remove the breakpoint before the next check.// Assign field values of the ticket booth attendant.
this.ComoZoo.TicketBooth.Attendant.Name = "Sam";
this.ComoZoo.TicketBooth.Attendant.Number = 42;Name assignment in newComoZooButton_Click.New Como Zoo. Step over the Name and Number assignments with F10.this.ComoZoo.TicketBooth.Attendant.Name is "Sam".this.ComoZoo.TicketBooth.Attendant.Number is 42.F5 to continue. Stop debugging and remove the breakpoint before the next check.Before submitting, make sure the project runs and uses the expected object values.
MainWindow.xaml.cs, set a breakpoint on the closing brace of newComoZooButton_Click by clicking its left margin.F5 to start or continue the application. Click New Como Zoo.Debug > Windows > Watch > Watch 1. Enter each full expression below in a separate Watch row.this.ComoZoo.Name is "Como Zoo".this.ComoZoo.Capacity is 1000.this.ComoZoo.FeaturedAnimal.Name is "Dolly".this.ComoZoo.FeaturedAnimal.Weight is 35.3.this.ComoZoo.LadiesRoom.Capacity is 4.this.ComoZoo.MensRoom.Capacity is 4.this.ComoZoo.TicketBooth.TicketPrice is 15.00m.this.ComoZoo.TicketBooth.Attendant.Name is "Sam".this.ComoZoo.TicketBooth.Attendant.Number is 42.F5 to continue. Stop debugging and remove the breakpoint before the next check.Build > Build Solution. Open View > Error List and resolve any errors introduced by this task.Stop debugging, save your work, and submit according to your instructor's directions.
Zoo object is assigned to MainWindow.ComoZoo.Zoo stores its name and capacity.Zoo references a featured animal, two restrooms, and a ticket booth.