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: 9 additions & 2 deletions Zoo/src/AnimalNoise.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

import model.Squirrel;
import model.Example;
import model.Lion;
import model.Parrot;
Expand All @@ -15,12 +15,19 @@ public static void main(String[] args) {
* Add a call to your animal below this comment.
*/

//create instance of Squirrel
Squirrel squeaker = new Squirrel();
//Speak, Squeaker:
System.out.println(squeaker.speak());

// Creating an instance of the Parrot class
Parrot parrot = new Parrot("Green", "Amazon Parrot", 12);

//instantiating the binturong
Binturong binturong = new Binturong("male", 25, "Black");



// Printing the result of the makeNoise method from the Parrot class
System.out.println(parrot.makeNoise());

Expand All @@ -30,9 +37,9 @@ public static void main(String[] args) {

//New instance of Lion class
Lion myLion = new Lion("Adult", "Male", 200);

//Making noise:
System.out.println(myLion.makeNoise());


}

Expand Down
1 change: 1 addition & 0 deletions Zoo/src/model/Example.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public Example() {
// TODO Auto-generated constructor stub
}

//following git demo
/**
* @param habitat
* @param name
Expand Down
56 changes: 56 additions & 0 deletions Zoo/src/model/Squirrel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package model;

//added by Jenni

public class Squirrel {
private String habitat;
private String name;
private int age;
private String color;

public Squirrel() {
super();
}
public Squirrel(String habitat, String name, String color, int age) {
super();
this.habitat = habitat;
this.color = color;
this.name = name;
this.age = age;
}
public int getHabitat() {
return habitat;
}
public void setHabitat(String habitat) {
this.habitat = habitat;
}

public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}

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

public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}

@Override
public String toString() {
return "Squirrel [habitat=" + habitat + "color=" + color + ", age=" + age + ", name=" + name + "]";
}
public String makeNoise() {
return "Squeak Squeaker, Squeak Squeaken";
}
}