Skip to main content

Section 6.3 Growth Level

Subsection 6.3.1 Overview

The following program represents a simple management system to track the number of dogs in a shelter. It includes functionalities such as adding, deleting and displaying the count for a breed of dogs. However, the program contains several syntax and logical errors that prevent it from functioning properly.

Subsection 6.3.2 Instructions

  1. Initialize a static ArrayList of Integer called dogCounts that will store the number of dogs for each breed
  2. Review the code and correct the errors to ensure the program operates as expected
The expected output is:
Initial Dog Counts:
Breed 1 has 15 dogs.
Breed 2 has 30 dogs.
Breed 3 has 20 dogs.

Updated Dog Counts:
Breed 1 has 15 dogs.
Breed 2 has 35 dogs.
You have attempted of activities on this page.