diff --git a/Zoo/src/AnimalNoise.java b/Zoo/src/AnimalNoise.java index 1d51269..2009fba 100644 --- a/Zoo/src/AnimalNoise.java +++ b/Zoo/src/AnimalNoise.java @@ -1,4 +1,4 @@ - +import model.Squirrel; import model.Example; import model.Lion; import model.Parrot; @@ -15,12 +15,19 @@ public static void main(String[] args) { * Add a call to your animal below this comment. */ + //create instance of Squirrel + Squirrel squeaker = new Squirrel(); + //Speak, Squeaker: + System.out.println(squeaker.speak()); + // Creating an instance of the Parrot class Parrot parrot = new Parrot("Green", "Amazon Parrot", 12); //instantiating the binturong Binturong binturong = new Binturong("male", 25, "Black"); + + // Printing the result of the makeNoise method from the Parrot class System.out.println(parrot.makeNoise()); @@ -30,9 +37,9 @@ public static void main(String[] args) { //New instance of Lion class Lion myLion = new Lion("Adult", "Male", 200); - //Making noise: System.out.println(myLion.makeNoise()); + } diff --git a/Zoo/src/model/Example.java b/Zoo/src/model/Example.java index a9281ab..a7959bc 100644 --- a/Zoo/src/model/Example.java +++ b/Zoo/src/model/Example.java @@ -10,6 +10,7 @@ public Example() { // TODO Auto-generated constructor stub } + //following git demo /** * @param habitat * @param name diff --git a/Zoo/src/model/Squirrel.java b/Zoo/src/model/Squirrel.java new file mode 100644 index 0000000..af63320 --- /dev/null +++ b/Zoo/src/model/Squirrel.java @@ -0,0 +1,56 @@ +package model; + +//added by Jenni + +public class Squirrel { + private String habitat; + private String name; + private int age; + private String color; + + public Squirrel() { + super(); + } + public Squirrel(String habitat, String name, String color, int age) { + super(); + this.habitat = habitat; + this.color = color; + this.name = name; + this.age = age; + } + public int getHabitat() { + return habitat; + } + public void setHabitat(String habitat) { + this.habitat = habitat; + } + + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + + public String getName() { + return name; + } + public void setName(String species) { + this.name = name; + } + + public int getAge() { + return age; + } + public void setAge(int age) { + this.age = age; + } + + @Override + public String toString() { + return "Squirrel [habitat=" + habitat + "color=" + color + ", age=" + age + ", name=" + name + "]"; + } + public String makeNoise() { + return "Squeak Squeaker, Squeak Squeaken"; + } +}