Create a new class called Dog that is derived from the Pet class given in Listing 6.1 of Chapter 6. The new class has the additional attributes of breed (type String) and boosterShot (type boolean), which is true if the pet has had its booster shot and false if not. Give your classes a reasonable complement of constructors and accessor methods. Write a driver program to test all your methods, then write a program that reads in five pets of type Dog and displays the name and breed of all dogs that are over two years old and have not had their booster shots.

This project would be easier to do with an array of type Dog, but how to write class constructors for arrays has not been covered, so the code to process one dog has to be repeated five times.

See the code in Dog.java, DogTest.java, and DogBoosterShotList,java.

Computer Science & Information Technology

You might also like to view...

A ________ uses an aggregate function for data that can be grouped by two types of information and displays data in a compact, spreadsheet-like format.

a. crosstab query b. select query c. simple select query d. subquery

Computer Science & Information Technology

What does a service ticket (ST) provide in Kerberos authentication?

A. It serves as the authentication host. B. It provides proof that the subject is authorized to access an object. C. It provides proof that a subject has authenticated through a KDC and can request tickets to access other objects. D. It provides ticket granting services.

Computer Science & Information Technology