Problem

a. Create a BirdSighting class for the Birmingham Birdwatcher’s Club that includes data...

a. Create a BirdSighting class for the Birmingham Birdwatcher’s Club that includes data fields for a bird species sighted, the number seen, and the day of the year. For example, April 1 is the 91st day of the year, assuming it is not a leap year. The class also includes methods to get each field. In addition, create a default constructor that automatically sets the species to “robin” and the number and day to 1. Save the file as BirdSighting.java. Create an application named TestBirdSighting that demonstrates that each method works correctly. Save the file as TestBirdSighting.java.

b. Create an additional overloaded constructor for the BirdSighting class you created in Exercise 3a. This constructor receives parameters for each of the data fields and assigns them appropriately. Add any needed statements to the TestBirdSighting application to ensure that the overloaded constructor works correctly, save it, and then test it.

c. Create a class with the same functionality as the BirdSighting class, but create the default constructor to call the three-parameter constructor. Save the class as BirdSighting2.java. Create an application to test the new version of the class, and name it TestBirdSighting2.java.

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