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.

78 lines
1.5 KiB

  1. import java.util.*;
  2. public abstract class Pet {
  3. private int petId;
  4. private String name;
  5. private double weight;
  6. private Date dob;
  7. private Double accumulatedDose;
  8. private ArrayList<Dose> doses;
  9. //Constructor
  10. public Pet(){
  11. this.doses = new ArrayList<Dose>();
  12. }
  13. public Pet(int petId, String name, double weight, Date dob, double accumulatedDose){
  14. this.petId = petId;
  15. this.name = name;
  16. this.weight = weight;
  17. this.dob = dob;
  18. this.accumulatedDose = accumulatedDose;
  19. this.doses = new ArrayList<Dose>();
  20. }
  21. // Setter
  22. public void setPetId(int petId){
  23. this.petId = petId;
  24. }
  25. public void setName(String name){
  26. this.name = name;
  27. }
  28. public void setWeight(double weight){
  29. this.weight = weight;
  30. }
  31. public void setDob(Date dob){
  32. this.dob = dob;
  33. }
  34. public void accumulatedDose(double accumulatedDose){
  35. this.accumulatedDose = accumulatedDose;
  36. }
  37. public void setDoses(ArrayList<Dose> doses){
  38. this.doses = doses;
  39. }
  40. // Getter
  41. public int getPetId(){
  42. return this.petId;
  43. }
  44. public String getName(){
  45. return this.name;
  46. }
  47. public double getWeight(){
  48. return this.weight;
  49. }
  50. public Date getDob(){
  51. return this.dob;
  52. }
  53. public double getAccumulatedDose(){
  54. return this.accumulatedDose;
  55. }
  56. public ArrayList<Dose> getDoses(){
  57. return this.doses;
  58. }
  59. public int findAge(){
  60. int differentMonth = 0;
  61. Date firstDate = this.dob;
  62. Date secondDate = new Date();
  63. }
  64. // public abstract double getDose();
  65. }