Question
Problem Statement : Write a program to perform a bird survey to count the number of birds of each species in an area. Create a
Problem Statement:
Write a program to perform a bird survey to count the number of birds of each species in an area. Create a class BirdSurvey that is a linked list. The linked list can be one way linked list, circular linked list or a doubly linked list; whichever you choose.
BirdSurvey should have the following operations in addition to those normally found in your linked list class:
- add(bird) adds the bird species birdto the end of the list, if it is not already there. sets its count to 1; otherwise, adds 1 to the count for bird.
- getCount(bird) returns the count associated with the species bird. If birdis not on the list, returns zero.
- getReport() displays the name and count for each bird species on the list.
You will write a program that uses BirdSurvey to record the data from a recent bird survey. Use a loop to read bird names until doneis entered. Illustrate the use of each of the methods mentioned above, with the last being a Report of all the species of birds entered and the count for each species.
Test
Test your code with sample data.
Now make sure that your code is the best it can be. Check your formatting, comments, and make sure your output is correct and communicates what is happening in your code.
output should look like this ;
in java
Added "Turkey" there is now 1 of them Added "Owl" there is now 1 of them Added "Turkey" there is now 2 of them Added "Eagle" there is now 1 of them Added "Parrot" there is now 1 of them Added "Eagle" there is now 2 of them Added "Heron" there is now 1 of them Added "Owl" there is now 2 of them Added "Turkey" there is now 3 of them Added "Turkey" there is now 4 of them Counted 4 Turkey(s) Counted 2 Owl(s) Counted 2 Eagle(s) Counted 1 Parrot(s) Counted 1 Heron(s) Counted O Kiwi(s) Final Report*** Species: Turkey, Count: 4 Species: Owl, Count: 2 Species: Eagle, Count: 2 Species: Parrot, Count: 1 Species: Heron, Count:1 NOTE:- Create linked list from scratch for assignmentStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started