|
|
- import java.util.*;
- public class Dog extends Pet {
-
- private String breed;
-
- public Dog(){
- super();
- this.breed = "";
- }
-
- public Dog(int petId, String name, double weight, Date dob, double accumulatedDose, String breed){
- super(petId, name, weight, dob, accumulatedDose);
- this.breed = breed;
- }
-
- //Setter
- public void setBreed(String breed){
- this.breed = breed;
- }
-
- //Getter
- public String getBreed(){
- return this.breed;
- }
-
- public double getDose(){
- if (getAccumulatedDose() > 750){
- return 0;
- // }else if( findAge() < 3){
- // return 0;
- // }else if(findAge() > 12 && getWeight() <2){
- // return 6 + 0.75 * getWeight();
- }else{
- return 12 + 0.65* getWeight();
- }
- }
-
- public String toString(){
- return "petID=" + getPetId() +
- ", name='" + getName() + '\'' +
- ", weight=" + getWeight() +
- // ", dob=" + VetClinicConsole.dateToStr(getDob()) +
- // ", accumulatedDose=" + getAccumulatedDose() +
- ",breed='" + breed + '\'';
- }
-
- }
|