From 2f3d549445f8a1861f59da96ba2b0ae3a6f7d0f6 Mon Sep 17 00:00:00 2001 From: empope1 Date: Wed, 24 Jan 2024 18:56:37 -0600 Subject: [PATCH] makeNoise Pig --- .project | 11 ++++++ Zoo/bin/.gitignore | 2 ++ Zoo/bin/main/Runner.class | Bin 612 -> 931 bytes Zoo/src/main/Runner.java | 6 ++++ Zoo/src/model/Pig.java | 69 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 88 insertions(+) create mode 100644 .project create mode 100644 Zoo/bin/.gitignore create mode 100644 Zoo/src/model/Pig.java 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 87c83e62b518850c14c2c798e4b5e24d3737cfa9..bc5e5b1238be2bfe8be68471cce7a19eaa40e92d 100644 GIT binary patch delta 453 zcma)&%Sr+P6o&ufrMWnEnQoL|T4|crbT6CQg)0LoFkB8eOp`hzIt8tK2v@Cp0$V5~ z^Z-3a^cc}GA&NFF&wu{^JD0b>qaeS2Jih=q#YtC=Q(M3iL8`kIv!)eoOGKOy%-d$I zB4UL*Ww%*vUE57lM1l|~+D=tQ6l)5CND*?W!i{lfXf?yJv`epPJC^<*C0&xRj;zo| zhA{a9ao_UHx`GXC68!G1N0=S)Y*#BX-s2&rQP+n{L}YAZSHKQo`U~;fqhJsF1femE z)f^`MUDmIsOPvfwr~D1uB7_RxpXlW2g2p-zbS6mF?Cs8?IU^qgmktCt%t2HJAIr6<~Rq8Giw52sEA+&306a_#zsV*5#~zd U+YWFDVowN1$T5L%%pD)}PXeA~3IG5A delta 133 zcmZ3?{)C0=)W2Q(7#J9A8I(41DKbvhVUn91$K=n*I(Z$F3nvEy2LmSq4+Gca-%OgJ zUJOh?$iTq2n?XEsJAQCI&?SzcLZ( 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!!"; + } +}