Problem

Suppose that we would like to perform a bird survey to count the number of birds of each s...

Suppose that we would like to perform a bird survey to count the number of birds of each species in an area. Create a class BirdSurvey that is like one of the linked-list classes. (The linked list you use will affect what your new class can do, so give some thought to your choice.) Modify the inner node class to add room for a count.

BirdSurvey should have the following operations:

• add(bird)—adds the bird species bird to the end of the list, if it is not already there, and sets its count to 1; otherwise, adds 1 to the count for bird.

• getCount(bird)—returns the count associated with the species bird. If bird is not on the list, returns zero.

• getReport—displays the name and count for each bird species on the list.

Write a program that uses BirdSurvey to record the data from a recent bird survey. Use a loop to read bird names until done is entered. Display a report when finished.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT