Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @(#)DogInfo.java
- *
- *
- * @author
- * @version 1.00 2020/2/28
- */
- public class DogInfo {
- String DogName;
- boolean isVip;
- boolean isBig;
- boolean isSmall;
- boolean biter;
- boolean walk;
- boolean train;
- boolean cuddle;
- public DogInfo() {
- DogName= "Snoop Dog";
- isVip=false;
- isBig=false;
- isSmall=false;
- biter=false;
- walk=false;
- train=false;
- cuddle=false;
- }
- public void enterData(){
- Scanner in= new Scanner(System.in);
- System.out.print("Enter [1] if your dog is VIP, enter [0] if its not a VIP: ");
- isVip=in.nextInt()==1;
- System.out.println();
- System.out.print("Enter [1] if your dog is bigger, enter [0] if its not bigger: ");
- isBig=in.nextInt()==1;
- System.out.println();
- System.out.print("Enter [1] if your dog is smaller, enter [0] if its not smaller: ");
- isSmall=in.nextInt()==1;
- System.out.println();
- System.out.print("Enter [1] if your dog is a biter, enter [0] if its not a biter: ");
- biter=in.nextInt()==1;
- System.out.println();
- System.out.print("Enter [1] if your dog needs a walk, enter [0] if it does not need a walk: ");
- walk=in.nextInt()==1;
- System.out.println();
- System.out.print("Enter [1] if your dog needs training, enter [0] if it does not need training: ");
- train=in.nextInt()==1;
- System.out.println();
- System.out.print("Enter [1] if your dog needs a cuddle, enter [0] if it does not need a cuddle: ");
- cuddle=in.nextInt()==1;
- System.out.println();
- }
- public boolean getVip(){return isVip;}
- public boolean getBig(){return isBig;}
- public boolean getSmall(){return isSmall;}
- public boolean getBiter(){return biter;}
- public boolean getWalk(){return walk;}
- public boolean getTrain(){return train;}
- public boolean getCuddle(){return cuddle;}
- public void setVip(boolean a){isVip=a;}
- public void setBig(boolean a){isBig=a;}
- public void setSmall (boolean a) {isSmall=a;}
- public void setBiter (boolean a) {biter=a;}
- public void setWalk (boolean a) {walk=a;}
- public void setTrain(boolean a){train=a;}
- public void setCuddle (boolean a){cuddle=a;}
- }
- /**
- * @(#)DogNode.java
- *
- *
- * @author
- * @version 1.00 2020/2/28
- */
- public class DogNode {
- DogInfo dog;
- DogNode next;
- public DogNode() {
- dog=new DogInfo();
- next=null;
- }
- public DogInfo getValue(){return dog; }
- public DogNode getNext(){return next; }
- public void setValue(DogInfo a){dog=a; }
- public void setNext(DogNode a){next=a; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement