A+ Work




Q For this program you will create a system of classes to support a Veterinary Clinic. Your program should consist of the following classes:

• Pet class: create a class to maintain a Pet record. You must maintain the following information about a Pet:

o name of the pet

o owner’s name of the pet

o weight of the pet

o number of visits

o total cost of all visits to the vet

The class should have proper getters and setters with the exception that there should not be a set method for the total cost of all visits or number of visits (these attributes should only be modified through the visit method).

The class should also contain a toString() method (see sample output for how this should print).

• Cat class: is a subclass of the Pet class; include an instance data member that keeps track of whether this is an inside only cat, or if it sometimes goes outside. 

• Dog class: is a subclass of the Pet class; include an instance data member to classify the dog as a small, medium, or large breed.

• visit method: The Pet class must contain a method called visit that is called each time the pet visits the vet. This method will help keep track of the number of visits as well as the total cost of all visits to the vet. For all Pets, the standard cost is $85 plus $30 times the number of shots. The visit method will take the number of shots as a parameter. For Cats, there is an additional charge of $20 to clean the teeth (which we will assume is done every visit), and an extra shot for outside cats (again, done every visit). For Dogs there is an additional charge of $15 to trim the nails (every time), and surcharges of $2.50/shot for medium size breeds and $5/shot for large breeds. 

• Vet class: holds the name of the veterinary clinic and holds a collection of Pets. This class must implement the Database.java interface (below). This means the vet class must provide all the capabilities laid out in the Database.java class (e.g. find, delete, etc).