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
6 changes: 6 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ZooDMACCJava2Spring2023</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
5 changes: 4 additions & 1 deletion src/AnimalNoises.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import model.Platypus;

import model.Dog;
import model.Example
import model.Example;
import model.Cat;
import model.Cow;
public class AnimalNoises {

// add your animal class to the model package
Expand All @@ -23,6 +23,9 @@ public static void main(String[] args) {
Cat jordan = new Cat("Jordan",6,true);
System.out.println(jordan.getName() + " Age: " + jordan.getAge() + " Is Loved: " + jordan.getIsLoved());
System.out.println(jordan.getName() + ": " + jordan.speak());
//created a new instance of a Cow and output the sound it makes (Jacoby King 01/17/23)
Cow susan = new Cow("Farm", "Susan", 10);
System.out.println(susan.getName() + ": " + susan.makeNoise());
}

}
72 changes: 72 additions & 0 deletions src/model/Cow.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package model;

/**
* @author jacoby - jking11@dmacc.edu
* CIS175 - Spring 2023
* Jan 17, 2023
*/
public class Cow {
private String habitat;
private String name;
private int age;
/**
*
*/
public Cow() {
super();
}
/**
* @param habitat
* @param name
* @param age
*/
public Cow(String habitat, String name, int age) {
super();
this.habitat = habitat;
this.name = name;
this.age = age;
}
/**
* @return the habitat
*/
public String getHabitat() {
return habitat;
}
/**
* @param habitat the habitat to set
*/
public void setHabitat(String habitat) {
this.habitat = habitat;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the age
*/
public int getAge() {
return age;
}
/**
* @param age the age to set
*/
public void setAge(int age) {
this.age = age;
}
@Override
public String toString() {
return "Cow [habitat=" + habitat + ", name=" + name + ", age=" + age + "]";
}
public String makeNoise() {
return "Moo!";
}
}