Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ZooDMACCJava2Spring2024</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
2 changes: 2 additions & 0 deletions Zoo/bin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/model/
/main/
Binary file modified Zoo/bin/main/Runner.class
Binary file not shown.
6 changes: 6 additions & 0 deletions Zoo/src/main/Runner.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main;

import model.Example;
import model.Pig;

public class Runner {

Expand All @@ -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());

}
}
69 changes: 69 additions & 0 deletions Zoo/src/model/Pig.java
Original file line number Diff line number Diff line change
@@ -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!!";
}
}