diff --git a/.project b/.project new file mode 100644 index 0000000..dd0e99b --- /dev/null +++ b/.project @@ -0,0 +1,11 @@ + + + ZooDMACCJava2Spring2024 + + + + + + + + diff --git a/Zoo/bin/.gitignore b/Zoo/bin/.gitignore new file mode 100644 index 0000000..a8efae8 --- /dev/null +++ b/Zoo/bin/.gitignore @@ -0,0 +1,2 @@ +/model/ +/main/ diff --git a/Zoo/bin/main/Runner.class b/Zoo/bin/main/Runner.class index 87c83e6..bc5e5b1 100644 Binary files a/Zoo/bin/main/Runner.class and b/Zoo/bin/main/Runner.class differ diff --git a/Zoo/src/main/Runner.java b/Zoo/src/main/Runner.java index ed1b309..f2c4c0b 100644 --- a/Zoo/src/main/Runner.java +++ b/Zoo/src/main/Runner.java @@ -1,6 +1,7 @@ package main; import model.Example; +import model.Pig; public class Runner { @@ -13,5 +14,10 @@ private void go() { Example example = new Example(); example.makeNoise(); + //create instance of animal and print results + Pig pig = new Pig ("Field", "Yorkshire", "Pink"); + + System.out.println(pig.makeNoise()); + } } diff --git a/Zoo/src/model/Pig.java b/Zoo/src/model/Pig.java new file mode 100644 index 0000000..504bdfc --- /dev/null +++ b/Zoo/src/model/Pig.java @@ -0,0 +1,69 @@ +package model; + +/** + * @author mallorykeary empope1 + * CIS 175 Spring 2024 + * Jan 24, 2024 + */ +public class Pig { + + //Instance variables + private String habitat; + private String breed; + private String color; + + //constructors + public Pig() { + super(); + // TODO Auto-generated constructor stub + } + + + public Pig(String habitat, String breed, String color) { + super(); + this.habitat = habitat; + this.breed = breed; + this.color = color; + } + + //Getters and setters + public String getHabitat() { + return habitat; + } + + + public void setHabitat(String habitat) { + this.habitat = habitat; + } + + + public String getBreed() { + return breed; + } + + + public void setBreed(String breed) { + this.breed = breed; + } + + + public String getColor() { + return color; + } + + + public void setColor(String color) { + this.color = color; + } + + + @Override + public String toString() { + return "Pig [habitat=" + habitat + ", breed=" + breed + ", color=" + color + "]"; + } + + //makeNoise method + public String makeNoise() { + return "The " + color + " " + breed + " Pig goes OINK!!"; + } +}