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.
Binary file modified Zoo/bin/model/Example.class
Binary file not shown.
5 changes: 5 additions & 0 deletions Zoo/src/main/Runner.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package main;

import model.Elephant;
import model.Example;

public class Runner {
Expand All @@ -13,5 +14,9 @@ private void go() {
Example example = new Example();
example.makeNoise();

Elephant elephant = new Elephant("Savanna", "Blue", 28.4);

System.out.println(elephant.makeNoise());

}
}
61 changes: 61 additions & 0 deletions Zoo/src/model/Elephant.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* @author Cory Howard - clhoward1
* CIS175 - Spring 2024
* Jan 25, 2024
*/
package model;

public class Elephant {
private String habitat;
private String name;
private double length;


/**
* Constructors
*/
public Elephant() {
super();
}

public Elephant(String habitat, String name, double length) {
super();
this.habitat = habitat;
this.name = name;
this.length = length;
}


/**
* Getters and Setters
*/
public String getHabitat() {
return habitat;
}
public void setHabitat(String habitat) {
this.habitat = habitat;
}

public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}

public double getLength() {
return length;
}
public void setLength(int length) {
this.length = length;
}

@Override
public String toString() {
return "Example [name=" + name + ", length=" + length + "inches, habitat=" + habitat + "]";
}

public String makeNoise() {
return "Toot!";
}
}