Question: JAVA. Please I need the same output! Counting animals in a zoo All similar animals in a zoo share the same cage. For example, south
JAVA. Please I need the same output! Counting animals in a zoo All similar animals in a zoo share the same cage. For example, south china tiger and javan tiger are in the same cage, and we only want to know there are two tigers. Given an integer K, followed by K lines describing animals, count and output in alphabetical order the animals in the zoo. The input data file includes multiple cases. Each case contains a number K (0<=K<=500), followed by K lines of animals with at least one word on each line, and the last word describing the kind of animal. For example, Caspian tiger is a tiger (obviously). The input is terminated by a 0. Output: For each test case, count and output the number for each animal type in alphabetic order: animal type followed by : and the number of that type animal. Other requirements: class name: CountingAnimals.java Sample input Sample output 5 List 1: Bengal tiger bear : 2 Brown bear tiger : 3 Sun bear List 2: South China tiger penguin : 2 Bali tiger 2 King penguin Fiordland penguin 0
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
