1. //dog class
  2. public class Dog{
  3. private String name;
  4. private int ownerID;
  5. private String breed;
  6. private double age;
  7. private double weight;
  8.  
  9. public Dog(String name, int ownerID, String breed, double age, double weight)
  10. {
  11. this.name = name;
  12. this.ownerID = ownerID;
  13. this.breed = breed;
  14. this.age = age;
  15. this.weight = weight;
  16. }
  17. //set methods
  18. public void setName(String name){
  19. this.name = name;
  20. }
  21. public void setOwnerID(int ownerID){
  22. this.ownerID = ownerID;
  23. }
  24. public void setBreed(String breed){
  25. this.breed = breed;
  26. }
  27. public void setAge(double age){
  28. this.age = age;
  29. }
  30. public void setWeight(double weight){
  31. this.weight = weight;
  32. }
  33. //print methods
  34. public void printName(){
  35. System.out.println("Dog name: " + name);
  36. }
  37. public void printOwnerID(){
  38. System.out.println("Owner ID: " + ownerID);
  39. }
  40. public void printBreed(){
  41. System.out.println("Dog breed: " + breed);
  42. }
  43. public void printAge(){
  44. System.out.println("Dog age: " + age);
  45. }
  46. public void printWeight(){
  47. System.out.println("Dog weight: " + weight);
  48. }
  49. public void printAll(){
  50. printName();
  51. printOwnerID();
  52. printBreed();
  53. printAge();
  54. printWeight();
  55. System.out.println("");
  56. }
  57. }