Assignment 1 Java 2 International class
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

47 lines
1.1 KiB

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 + '\'';
}
}