From 9ff888db1a12156560e6609cf502d2297fce0847 Mon Sep 17 00:00:00 2001 From: Celyn Johns <143140229+CelynvJohns@users.noreply.github.com> Date: Wed, 30 Aug 2023 17:44:27 -0500 Subject: [PATCH 1/3] Update AnimalNoise.java Added in the panda's information. Set up what the variables were, added the panda's noise, added the panda's toString. Also reordered the way the animals are so that all the animals are first created and then make a noise. --- Zoo/src/AnimalNoise.java | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/Zoo/src/AnimalNoise.java b/Zoo/src/AnimalNoise.java index 1d51269..5503ad4 100644 --- a/Zoo/src/AnimalNoise.java +++ b/Zoo/src/AnimalNoise.java @@ -3,37 +3,41 @@ import model.Lion; import model.Parrot; import model.Binturong; +import model.panda; 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); - //instantiating the binturong + // instantiating the binturong Binturong binturong = new Binturong("male", 25, "Black"); + + // New instance of Lion class + Lion myLion = new Lion("Adult", "Male", 200); + + // New instance of Panda class + Panda panda = new Panda("Bamboo Forest", "Bambi", 2); // Printing the result of the makeNoise method from the Parrot class System.out.println(parrot.makeNoise()); - - //binturong go moo + // binturong go moo System.out.println(binturong.speak()); - //New instance of Lion class - Lion myLion = new Lion("Adult", "Male", 200); - - //Making noise: + // Making noise: System.out.println(myLion.makeNoise()); + // Creating Panda noise + System.out.println(panda.makeNoise()); + + // Creating Panda ToString + System.out.println(panda.toString()); + } } From 37bb937b263a6bfaeea359930ee6a795ad8aea95 Mon Sep 17 00:00:00 2001 From: Celyn Johns <143140229+CelynvJohns@users.noreply.github.com> Date: Wed, 30 Aug 2023 17:45:46 -0500 Subject: [PATCH 2/3] Created a Panda class Added Panda to the zoo, where they have a habitat, name, and age. Set up the getters and setters, and then added a toString and makeNoise. --- Zoo/src/model/Panda.java | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Zoo/src/model/Panda.java diff --git a/Zoo/src/model/Panda.java b/Zoo/src/model/Panda.java new file mode 100644 index 0000000..67f52c6 --- /dev/null +++ b/Zoo/src/model/Panda.java @@ -0,0 +1,4 @@ + +public class Panda { + +} From ad57ef002e1ab06b9605c97dc1532efa9546ca06 Mon Sep 17 00:00:00 2001 From: Celyn Johns <143140229+CelynvJohns@users.noreply.github.com> Date: Wed, 30 Aug 2023 17:54:10 -0500 Subject: [PATCH 3/3] Update AnimalNoise.java --- Zoo/src/AnimalNoise.java | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Zoo/src/AnimalNoise.java b/Zoo/src/AnimalNoise.java index 5503ad4..785f392 100644 --- a/Zoo/src/AnimalNoise.java +++ b/Zoo/src/AnimalNoise.java @@ -3,35 +3,41 @@ import model.Lion; import model.Parrot; import model.Binturong; -import model.panda; +import model.Panda; 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); - // instantiating the binturong + //instantiating the binturong Binturong binturong = new Binturong("male", 25, "Black"); - - // New instance of Lion class - Lion myLion = new Lion("Adult", "Male", 200); - - // New instance of Panda class - Panda panda = new Panda("Bamboo Forest", "Bambi", 2); // Printing the result of the makeNoise method from the Parrot class System.out.println(parrot.makeNoise()); - // binturong go moo + + //binturong go moo System.out.println(binturong.speak()); - // Making noise: + //New instance of Lion class + Lion myLion = new Lion("Adult", "Male", 200); + + //Making noise: System.out.println(myLion.makeNoise()); + // New instance of Panda class + Panda panda = new Panda("Bamboo Forest", "Bambi", 2); + // Creating Panda noise System.out.println(panda.makeNoise());