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
9 changes: 8 additions & 1 deletion 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.Penguin;

public class Runner {

Expand All @@ -11,7 +12,13 @@ public static void main(String[] args) {

private void go() {
Example example = new Example();
example.makeNoise();
System.out.println(example.makeNoise());

// Creating an instance of the Penguin class
Penguin penguin = new Penguin("Emperor", "Antarctica", 100);

// Making the penguin go HONK!!!!
System.out.println(penguin.makeNoise());

}
}
59 changes: 59 additions & 0 deletions Zoo/src/model/Penguin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/**
* @author TrevorDickey - tjdickey
* CIS175 - Fall 2023
* Aug 29, 2023
*/
package model;

/**
*
*/
public class Penguin {
// Instance variables representing the species, habitat, and height of the Penguin
private String species;
private String habitat;
private int height; //in centimeters

public Penguin() {
super();
}

public Penguin(String species, String habitat, int height) {
super();
this.species = species;
this.habitat = habitat;
this.height = height;
}

public String getSpecies() {
return species;
}

public void setSpecies(String species) {
this.species = species;
}

public String getHabitat() {
return habitat;
}

public void setHabitat(String habitat) {
this.habitat = habitat;
}

public int getHeight() {
return height;
}

public void setHeight(int height) {
this.height = height;
}

@Override
public String toString() {
return "Penguin [species=" + species + ", habitat=" + habitat + ", height=" + height + " centimeters]";
}

public String makeNoise() {
return "The " + species + " Penguin says HONK!";}
}