From 090561eab7677d3a25fdceb4cb43ad345f90c07a Mon Sep 17 00:00:00 2001 From: JenniLJ <48532943+JenniLJ@users.noreply.github.com> Date: Wed, 30 Aug 2023 20:03:38 -0500 Subject: [PATCH 1/2] Following Git Demo --- Zoo/src/model/Example.java | 1 + 1 file changed, 1 insertion(+) 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 From 04b36e18cc662bd71a3138721fb72a6ee6308601 Mon Sep 17 00:00:00 2001 From: JenniLJ <48532943+JenniLJ@users.noreply.github.com> Date: Wed, 30 Aug 2023 20:50:51 -0500 Subject: [PATCH 2/2] Created Squirrel Model, and made call for Squirrel Speak in Animal Noise. --- Zoo/src/AnimalNoise.java | 11 ++++++-- Zoo/src/model/Squirrel.java | 56 +++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 Zoo/src/model/Squirrel.java 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/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"; + } +}