Question: Project 3: This program will have There are 10 cages in Zoo Each cage can contain one animal a tiger or a duck. main class

 Project 3: This program will have There are 10 cages in

Project 3: This program will have There are 10 cages in Zoo Each cage can contain one animal a tiger or a duck. main class called Zoo All classes will reside in package zoo. Class Zoo method addAnimal(Animal a) remove Animal(int x) printAll) /print info about all animals in the zoo. Main: Add and remove these animals in main. Assume all animals have unique names We may test other sequences Duck d1 = new Duck( "donald", 3); zoo.addAnimal (d1); 4); Duck d2 = new Duck( "dona", zoo.addAnimal (d2); Tiger c1 = new Tiger( "nancy", 1200); zoo.addAnimal (c1); Tiger c2 = new Tiger( "harry", 800); zoo.addAnimal (c2); zoo.printAll); zoo.removeAnimal("nancy"); zoo.printAll); Duck d3 = new Duck("James", 5); zoo.addAnimal (d3); zoo.printAll)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!