From 3a9c6a4f90bbd7944020b8da6043f5b072a08291 Mon Sep 17 00:00:00 2001 From: masedykh <143488930+masedykh@users.noreply.github.com> Date: Wed, 30 Aug 2023 23:47:45 -0500 Subject: [PATCH 1/3] Create Cow.class --- Zoo/bin/model/Cow.class | 1 + 1 file changed, 1 insertion(+) create mode 100644 Zoo/bin/model/Cow.class diff --git a/Zoo/bin/model/Cow.class b/Zoo/bin/model/Cow.class new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Zoo/bin/model/Cow.class @@ -0,0 +1 @@ + From 3fe8fe5d36a70512e973542a781e335461b2bb75 Mon Sep 17 00:00:00 2001 From: masedykh <143488930+masedykh@users.noreply.github.com> Date: Wed, 30 Aug 2023 23:59:41 -0500 Subject: [PATCH 2/3] Add files via upload --- Zoo/src/AnimalNoise.java | 49 ++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/Zoo/src/AnimalNoise.java b/Zoo/src/AnimalNoise.java index 1d51269..c9f19f0 100644 --- a/Zoo/src/AnimalNoise.java +++ b/Zoo/src/AnimalNoise.java @@ -6,34 +6,39 @@ 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. - */ + public static void main(String[] args) { + Example example = new Example(); + System.out.println(example.makeNoise()); - // Creating an instance of the Parrot class - Parrot parrot = new Parrot("Green", "Amazon Parrot", 12); + /* + * + * Add a call to your animal below this comment. + */ - //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()); + // 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"); - //binturong go moo - System.out.println(binturong.speak()); + // Printing the result of the makeNoise method from the Parrot class + System.out.println(parrot.makeNoise()); - //New instance of Lion class - Lion myLion = new Lion("Adult", "Male", 200); + // binturong go moo + System.out.println(binturong.speak()); - //Making noise: - System.out.println(myLion.makeNoise()); + // New instance of Lion class + Lion myLion = new Lion("Adult", "Male", 200); - } + // Making noise: + System.out.println(myLion.makeNoise()); + + // New instance of Cow class + Cow myCow = new Cow("Infant", "Female", 175); + + // Cow noise: + System.out.println(myCow.makeNoise()); + + } } From 3519cf2ca952169acc9a296974334e1615523119 Mon Sep 17 00:00:00 2001 From: masedykh <143488930+masedykh@users.noreply.github.com> Date: Thu, 31 Aug 2023 00:13:39 -0500 Subject: [PATCH 3/3] Cow.java updated --- Zoo/src/model/Cow.java | 86 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 Zoo/src/model/Cow.java diff --git a/Zoo/src/model/Cow.java b/Zoo/src/model/Cow.java new file mode 100644 index 0000000..1a7ec2c --- /dev/null +++ b/Zoo/src/model/Cow.java @@ -0,0 +1,86 @@ +/** + * @author Michael Sedykh - masedykh + * CIS175 - Fall 2023 + * Aug 30, 2023 + */ + + +package model; + +public class Lion { + + private String lifeStage; //adult, infant, cowling + private String gender; //male, female, intersex + private int weight; //in kilograms + + //Default constructor: + public Cow() { + super(); + } + + /** + * @param lifeStage + * @param gender + * @param weight + */ + public Lion(String lifeStage, String gender, int weight) { + super(); + this.lifeStage = lifeStage; + this.gender = gender; + this.weight = weight; + } + + /** + * @return the lifeStage + */ + public String getLifeStage() { + return lifeStage; + } + + /** + * @param lifeStage the lifeStage to set + */ + public void setLifeStage(String lifeStage) { + this.lifeStage = lifeStage; + } + + /** + * @return the gender + */ + public String getGender() { + return gender; + } + + /** + * @param gender the gender to set + */ + public void setGender(String gender) { + this.gender = gender; + } + + /** + * @return the weight + */ + public int getWeight() { + return weight; + } + + /** + * @param weight the weight to set + */ + public void setWeight(int weight) { + this.weight = weight; + } + + // Overrides toString method to return a string representation of the Lion object + @Override + public String toString() { + + return "Cow [gender= " + gender + ", life stage = " + lifeStage + ", weight=" + weight + "kilograms. ]"; + } + + // Method to return the noise made by the Cow + public String makeNoise() { + return "MOOOOOOOOOOO!"; + } +}