Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. /**
  2. * @(#)DogInfo.java
  3. *
  4. *
  5. * @author
  6. * @version 1.00 2020/2/28
  7. */
  8.  
  9.  
  10. public class DogInfo {
  11. String DogName;
  12. boolean isVip;
  13. boolean isBig;
  14. boolean isSmall;
  15. boolean biter;
  16. boolean walk;
  17. boolean train;
  18. boolean cuddle;
  19.  
  20. public DogInfo() {
  21. DogName= "Snoop Dog";
  22. isVip=false;
  23. isBig=false;
  24. isSmall=false;
  25. biter=false;
  26. walk=false;
  27. train=false;
  28. cuddle=false;
  29. }
  30.  
  31. public void enterData(){
  32. Scanner in= new Scanner(System.in);
  33.  
  34. System.out.print("Enter [1] if your dog is VIP, enter [0] if its not a VIP: ");
  35. isVip=in.nextInt()==1;
  36. System.out.println();
  37. System.out.print("Enter [1] if your dog is bigger, enter [0] if its not bigger: ");
  38. isBig=in.nextInt()==1;
  39. System.out.println();
  40. System.out.print("Enter [1] if your dog is smaller, enter [0] if its not smaller: ");
  41. isSmall=in.nextInt()==1;
  42. System.out.println();
  43. System.out.print("Enter [1] if your dog is a biter, enter [0] if its not a biter: ");
  44. biter=in.nextInt()==1;
  45. System.out.println();
  46. System.out.print("Enter [1] if your dog needs a walk, enter [0] if it does not need a walk: ");
  47. walk=in.nextInt()==1;
  48. System.out.println();
  49. System.out.print("Enter [1] if your dog needs training, enter [0] if it does not need training: ");
  50. train=in.nextInt()==1;
  51. System.out.println();
  52. System.out.print("Enter [1] if your dog needs a cuddle, enter [0] if it does not need a cuddle: ");
  53. cuddle=in.nextInt()==1;
  54. System.out.println();
  55. }
  56.  
  57. public boolean getVip(){return isVip;}
  58. public boolean getBig(){return isBig;}
  59. public boolean getSmall(){return isSmall;}
  60. public boolean getBiter(){return biter;}
  61. public boolean getWalk(){return walk;}
  62. public boolean getTrain(){return train;}
  63. public boolean getCuddle(){return cuddle;}
  64.  
  65. public void setVip(boolean a){isVip=a;}
  66. public void setBig(boolean a){isBig=a;}
  67. public void setSmall (boolean a) {isSmall=a;}
  68. public void setBiter (boolean a) {biter=a;}
  69. public void setWalk (boolean a) {walk=a;}
  70. public void setTrain(boolean a){train=a;}
  71. public void setCuddle (boolean a){cuddle=a;}
  72.  
  73.  
  74.  
  75. }
  76.  
  77.  
  78.  
  79.  
  80. /**
  81. * @(#)DogNode.java
  82. *
  83. *
  84. * @author
  85. * @version 1.00 2020/2/28
  86. */
  87.  
  88.  
  89. public class DogNode {
  90. DogInfo dog;
  91. DogNode next;
  92.  
  93. public DogNode() {
  94. dog=new DogInfo();
  95. next=null;
  96. }
  97.  
  98. public DogInfo getValue(){return dog; }
  99. public DogNode getNext(){return next; }
  100.  
  101. public void setValue(DogInfo a){dog=a; }
  102. public void setNext(DogNode a){next=a; }
  103.  
  104.  
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement