Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Cage
- {
- private int Length;
- private int Width;
- private int Height;
- private boolean Clean;
- private boolean Covered;
- public Cage()
- {
- Length = 10;
- Width = 10;
- Height = 10;
- Clean = true;
- Covered = false;
- }
- public void setLength(int Lenght)
- {
- this.Length = Length;
- }
- public void setWidth(int Width)
- {
- this.Width = Width;
- }
- public void setHeight(int Height)
- {
- this.Height = Height;
- }
- public void setClean(boolean Clean)
- {
- this.Clean = Clean;
- }
- public void setCovered(boolean Covered)
- {
- this.Covered = Covered;
- }
- public int getLength()
- {
- return this.Length;
- }
- public int getWidth()
- {
- return this.Width;
- }
- public int getHeight()
- {
- return this.Height;
- }
- public boolean isClean()
- {
- return this.Clean;
- }
- public boolean isCovered()
- {
- return this.Covered;
- }
- }
- class ZooAnimal
- {
- private String AName;
- private String Type;
- private int Age;
- private boolean Hungry;
- public ZooAnimal()
- {
- AName = " ";
- Type = " ";
- Age = 0;
- Hungry = false;
- }
- public void setName(String AName)
- {
- this.AName = AName;
- }
- public void setType(String Type)
- {
- this.Type = Type;
- }
- public void setAge(int Age)
- {
- this.Age = Age;
- }
- public void setHungry(boolean Hungry)
- {
- this.Hungry = Hungry;
- }
- public String getAName()
- {
- return this.AName;
- }
- public String getType()
- {
- return this.Type;
- }
- public int getAge()
- {
- return this.Age;
- }
- public boolean isHungry()
- {
- return this.Hungry;
- }
- }
- import java.util.*;
- class JavaZoo
- {
- public String ZooName = "Java Park n Zoo";
- public JavaZoo()
- {
- }
- public String getZooName()
- {
- return this.ZooName;
- }
- public static void main(String []args)
- {
- Scanner sc = new Scanner(System.in);
- ZooAnimal myFirstAnimal = new ZooAnimal();
- Cage myFirstCage=new Cage();
- ZooKeeper myFirstZooKeeper = new ZooKeeper();
- System.out.print("Input Animal Name: ");
- myFirstAnimal.setName(sc.nextLine());
- System.out.print("Input Animal Type: ");
- myFirstAnimal.setType(sc.nextLine());
- System.out.print("Clean Cage? : ");
- myFirstCage.setClean(sc.nextBoolean());
- System.out.print("Input Name of Zookeeper: ");
- sc.nextLine();
- myFirstZooKeeper.setName(sc.nextLine());
- System.out.print("ZooKeeper's Title: ");
- myFirstZooKeeper.setTitle(sc.nextLine());
- System.out.print("Has a Degree? : ");
- myFirstZooKeeper.Degree(sc.nextBoolean());
- System.out.println("\nAnimal");
- System.out.println("Animal Name: " + myFirstAnimal.getAName());
- System.out.println("Type: " + myFirstAnimal.getType());
- System.out.println("Age: " + myFirstAnimal.getAge());
- System.out.println("Not Hungry?: " + myFirstAnimal.isHungry());
- System.out.println("\nCage");
- System.out.println("Length: " + myFirstCage.getLength());
- System.out.println("Width: " + myFirstCage.getWidth());
- System.out.println("Height: " + myFirstCage.getHeight());
- System.out.println("Clean Cage? : " + myFirstCage.isClean());
- System.out.println("Covered Cage? : " + myFirstCage.isCovered());
- System.out.println("\nName");
- System.out.println("Name: " + myFirstZooKeeper.getName());
- System.out.println("Title: " + myFirstZooKeeper.getTitle());
- System.out.println("Payrate: " + myFirstZooKeeper.getPayrate());
- System.out.println("Degree? : " + myFirstZooKeeper.Degree());
- }
- }
- class ZooKeeper
- {
- private String Name;
- private String Title;
- private double Payrate;
- private boolean Degree;
- public ZooKeeper()
- {
- Name = " ";
- Title = " ";
- Payrate = 14.00;
- Degree = false;
- }
- public void setName(String Name)
- {
- this.Name = Name;
- }
- public void setTitle(String Title)
- {
- this.Title = Title;
- }
- public void setPayrate(double Payrate)
- {
- this.Payrate = Payrate;
- }
- public void Degree(boolean Degree)
- {
- this.Degree = Degree;
- }
- public String getName()
- {
- return this.Name;
- }
- public String getTitle()
- {
- return this.Title;
- }
- public double getPayrate()
- {
- return this.Payrate;
- }
- public boolean Degree()
- {
- return this.Degree;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement