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.
 

79 lines
1.5 KiB

import java.util.*;
public abstract class Pet {
private int petId;
private String name;
private double weight;
private Date dob;
private Double accumulatedDose;
private ArrayList<Dose> doses;
//Constructor
public Pet(){
this.doses = new ArrayList<Dose>();
}
public Pet(int petId, String name, double weight, Date dob, double accumulatedDose){
this.petId = petId;
this.name = name;
this.weight = weight;
this.dob = dob;
this.accumulatedDose = accumulatedDose;
this.doses = new ArrayList<Dose>();
}
// Setter
public void setPetId(int petId){
this.petId = petId;
}
public void setName(String name){
this.name = name;
}
public void setWeight(double weight){
this.weight = weight;
}
public void setDob(Date dob){
this.dob = dob;
}
public void accumulatedDose(double accumulatedDose){
this.accumulatedDose = accumulatedDose;
}
public void setDoses(ArrayList<Dose> doses){
this.doses = doses;
}
// Getter
public int getPetId(){
return this.petId;
}
public String getName(){
return this.name;
}
public double getWeight(){
return this.weight;
}
public Date getDob(){
return this.dob;
}
public double getAccumulatedDose(){
return this.accumulatedDose;
}
public ArrayList<Dose> getDoses(){
return this.doses;
}
public int findAge(){
int differentMonth = 0;
Date firstDate = this.dob;
Date secondDate = new Date();
}
// public abstract double getDose();
}