diff --git a/Pets/Cat.java b/Pets/Cat.java new file mode 100644 index 0000000..3a6ab48 --- /dev/null +++ b/Pets/Cat.java @@ -0,0 +1,46 @@ +import java.util.*; + +public class Cat extends Pet { + + private boolean allergic; + + public Cat(){ + + } + public Cat(int petId, String name, double weight, Date dob, double accumulatedDose, boolean allergic){ + super(petId, name, weight, dob, accumulatedDose); + this.allergic = allergic; + } +//Setter + public void setAllergic(boolean allergic){ + this.allergic = allergic; + } + +//Getter + public boolean getAllergic(){ + return this.allergic; + } + + public double getDose(){ + if ( getAccumulatedDose() > 500) { + return 0; + + // }else if(getAllergic() == true){ + // return 0; + // }else if( findAge() >3 && weight > 0.5){ + // return 7+0.61* getWeight(); + }else{ + return 0.81 * getWeight(); + } + } + + public String toString(){ + return "petID=" + getPetId() + + ", name='" + getName() + '\'' + + ", weight=" + getWeight() + + // ", dob=" + VetClinicConsole.dateToStr(getDob()) + + // ", accumulatedDose=" + getAccumulatedDose() + + ",allergic='" + allergic + '\''; + } + +} \ No newline at end of file diff --git a/Pets/Dog.java b/Pets/Dog.java new file mode 100644 index 0000000..6bbbd56 --- /dev/null +++ b/Pets/Dog.java @@ -0,0 +1,47 @@ +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 + '\''; + } + +} \ No newline at end of file diff --git a/Pets/Dose.java b/Pets/Dose.java new file mode 100644 index 0000000..94a6929 --- /dev/null +++ b/Pets/Dose.java @@ -0,0 +1,47 @@ +import java.util.*; + +public class Dose { + + private String nameOfDrug; + private Date date; + private double doseInGrams; + + public Dose(){ + this.nameOfDrug = ""; + Date date = new Date(); + this.date = date; + this.doseInGrams = 0.0; + } + + public Dose(String nameOfDrug, double doseInGrams){ + Date date = new Date(); + this.date = date; + this.nameOfDrug = nameOfDrug; + this.doseInGrams = doseInGrams; + } + + //Setter + public void setNameOfDrug(String nameOfDrug){ + this.nameOfDrug = nameOfDrug; + } + + public void setDate(Date date){ + this.date = date; + } + + public void setDoseInGrams(double doseInGrams){ + this.doseInGrams = doseInGrams; + } + + //Getter + public String getNameOfDrug(){ + return this.nameOfDrug; + } + + public Date getDate(){ + return this.date; + } + public double getDoseInGrams(){ + return this.doseInGrams; + } +} \ No newline at end of file diff --git a/Pets/Pet.java b/Pets/Pet.java new file mode 100644 index 0000000..5da4a9c --- /dev/null +++ b/Pets/Pet.java @@ -0,0 +1,79 @@ +import java.util.*; + +public abstract class Pet { + private int petId; + private String name; + private double weight; + private Date dob; + private Double accumulatedDose; + + private ArrayList doses; + +//Constructor + public Pet(){ + this.doses = new ArrayList(); + } + + 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(); + + } + + // 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 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 getDoses(){ + return this.doses; + } + + public int findAge(){ + int differentMonth = 0; + Date firstDate = this.dob; + Date secondDate = new Date(); + + } + + + // public abstract double getDose(); + +} \ No newline at end of file diff --git a/Pets/VetClinic.java b/Pets/VetClinic.java new file mode 100644 index 0000000..b0caee9 --- /dev/null +++ b/Pets/VetClinic.java @@ -0,0 +1,49 @@ +import java.util.*; + +public class VetClinic { + + private static Scanner scan; + private static int petId = 1; + + public static void main(String[] args) { + ArrayList pets = new ArrayList; + scan = new Scanner(System.in); + public static void printMainMenu();{ + System.out.println("1. Adding a Pet "); + System.out.println("2. Delete a Pet"); + System.out.println("3. Show all Pet(s)!"); + System.out.println("4. Add a drug for a Pet "); + System.out.println("5. Edit information Pet "); + System.out.println("6. Quit \n "); + System.out.println("Your Choice: "); + + } + + int choose = scan.nextLine(); + while (choose!= 0){ + switch(choose){ + case 1: + printChoicePet(); + + + case 2: + + + case 3: + + + case 4: + + + + case 5: + + + case 6: + + + } + } + + } +} \ No newline at end of file