Commit 85d03b28 authored by a-j.towse's avatar a-j.towse

WIP superSuper falcon

parent 2e06df45
No preview for this file type
...@@ -9,15 +9,19 @@ public class App { ...@@ -9,15 +9,19 @@ public class App {
Fish Rex = new Fish("Rex","red stripes","sea","sea-weed",12.5,"freshwater"); Fish Rex = new Fish("Rex","red stripes","sea","sea-weed",12.5,"freshwater");
Fish Pix = new Fish("Pix","gold","river","smaller fish",5.0,"saltwater"); Fish Pix = new Fish("Pix","gold","river","smaller fish",5.0,"saltwater");
Bird Fred = new Bird("Fred","pink feathers","savannah", "shrimp",false,true);
myZoo.addanimal(Rex); myZoo.addanimal(Rex);
myZoo.addanimal(Pix); myZoo.addanimal(Pix);
myZoo.addanimal(Fred);
myZoo.displayAnimalArrayList(); myZoo.displayAnimalArrayList();
myZoo.displayDetails(Rex); myZoo.displayDetails(Rex);
myZoo.displayfoodRequirements(Rex); myZoo.displayfoodRequirements(Rex);
myZoo.displayfoodRequirements(Pix); myZoo.displayfoodRequirements(Fred);
ArrayList<Animal> animalList = new ArrayList<>(); ArrayList<Animal> animalList = new ArrayList<>();
animalList.add(Rex); animalList.add(Rex);
...@@ -27,7 +31,7 @@ public class App { ...@@ -27,7 +31,7 @@ public class App {
myZoo.displayListDetials(animalList); myZoo.displayListDetials(animalList);
myZoo.displayEnvironmentList("sea"); myZoo.displayEnvironmentList("savannah");
} }
} }
......
public class Bird extends Animal{
public Bird() {
super();
}
public Bird(String name, String description, String environment, String foodType, Boolean predatory, Boolean flight) {
super(name, description, environment, foodType);
addDetail("Predatory: "+predatory);
addDetail("Flight: "+flight);
}
}
public class Fish extends Animal{ public class Fish extends Animal{
Double waterTemp;
String waterType;
public Fish() { public Fish() {
super(); super();
} }
public Fish(String name, String description, String environment, String foodType, Double waterTemp, String waterType) { public Fish(String name, String description, String environment, String foodType, Double waterTemp, String waterType) {
super(name, description, environment, foodType); super(name, description, environment, foodType);
this.waterTemp = waterTemp; addDetail("Water Temperature: "+waterTemp.toString());
this.waterType = waterType; addDetail("Water Type: "+waterType);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment