diff --git a/AnimalNoise.java b/AnimalNoise.java new file mode 100644 index 0000000..a749f14 --- /dev/null +++ b/AnimalNoise.java @@ -0,0 +1,44 @@ +//import model.Example; +import model.Lion; +import model.Parrot; +import model.Binturong; +import model.Tiger; + +public class AnimalNoise { + + public static void main(String[] args) { + //Example example = new Example(); + //System.out.println(example.makeNoise()); + + /* + * + * Add a call to your animal below this comment. + */ + + // Creating an instance of the Parrot class + Parrot parrot = new Parrot("Green", "Amazon Parrot", 12); + + // Printing the result of the makeNoise method from the Parrot class + System.out.println(parrot.makeNoise()); + + //instantiating the binturong + Binturong binturong = new Binturong("male", 25, "Black"); + + //binturong go moo + System.out.println(binturong.speak()); + + //New instance of Lion class + Lion Lion = new Lion("Adult", "Male", 200); + + //Making noise: + System.out.println(Lion.makeNoise()); + + //New instance of Lion class + Tiger Tiger = new Tiger("Brown", 7,"Siberian Tiger"); + + //Making noise: + System.out.println(Tiger.makeNoise()); + + } + +} diff --git a/Tiger.java b/Tiger.java new file mode 100644 index 0000000..c373045 --- /dev/null +++ b/Tiger.java @@ -0,0 +1,43 @@ +package model; + +public class Tiger { + private String color; + private int age; + private String species; + + public Tiger() { + super(); + } + + public Tiger(String color, int age, String species) { + super(); + this.color = color; + this.age = age; + this.species = species; + } + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public int getAge() { + return age; + } + public void setAge(int age) { + this.age = age; + } + public String getSpecies() { + return species; + } + public void setSpecies(String species) { + this.species = species; + } + @Override + public String toString() { + return "Tiger [color=" + color + ", age=" + age + ", species=" + species + "]"; + } + public String makeNoise() { + return "ROARRR!"; + } +}