Commit 2495f873 authored by jinny.wilkin's avatar jinny.wilkin

All animals made

parent aa036564
public class Baboon extends Mammal{
protected int hierarchy; //the monkeys have leaders
public Baboon(){
super();
hierarchy = 0;
}
public Baboon(String hb, String fd, String nm, int a, String integ, String gnd, int nol, int spd, double hgt, String fc, String loco, int hrchy){
super(hb, fd, nm, a, integ, gnd, nol, spd, hgt, fc, loco);
hierarchy = hrchy;
}
public void shout(){
System.out.println("OOAAAAOOOAAAAHAAAWWOOOHAAA");
}
}
...@@ -3,6 +3,14 @@ abstract class Bird extends Animal{ ...@@ -3,6 +3,14 @@ abstract class Bird extends Animal{
protected double migration; protected double migration;
protected String featherColour; protected String featherColour;
public Bird(){
super();
this.wingSpan = 5.5;
this.migration = 120;
this.featherColour = "Green";
}
public Bird(String hb, String fd, String nm, int a, String integ, String gnd, int nol, int spd, double ws, double mig, String fc){ public Bird(String hb, String fd, String nm, int a, String integ, String gnd, int nol, int spd, double ws, double mig, String fc){
super(hb, fd, nm, a, integ, gnd, nol, spd); super(hb, fd, nm, a, integ, gnd, nol, spd);
......
public class Chameleon extends Reptile{
protected String currentColour;
public Chameleon(){
super();
currentColour = "Pink";
}
public Chameleon(String hb, String fd, String nm, int a, String integ, String gnd, int nol, int spd, boolean amph, double len, String currCol){
super(hb, fd, nm, a, integ, gnd, nol, spd, amph, len);
currentColour = currCol;
}
}
public class Crocodile extends Reptile{
protected int numberOfTeeth;
public Crocodile(){
super();
numberOfTeeth = 1;
}
public Crocodile(String hb, String fd, String nm, int a, String integ, String gnd, int nol, int spd, boolean amph, double len, int not){
super(hb, fd, nm, a, integ, gnd, nol, spd, amph, len);
numberOfTeeth = not;
}
}
public class Emu extends Bird{ public class Emu extends Bird{
protected int runningSpeed; protected int runningSpeed;
public Emu(){
super();
this.runningSpeed = 20;
}
public Emu(String hb, String fd, String nm, int a, String integ, String gnd, int nol, int spd, double ws, double mig, String fc){ public Emu(String hb, String fd, String nm, int a, String integ, String gnd, int nol, int spd, double ws, double mig, String fc){
super(hb, fd, nm, a, integ, gnd, nol, spd, ws, mig, fc); super(hb, fd, nm, a, integ, gnd, nol, spd, ws, mig, fc);
this.runningSpeed = spd*3; this.runningSpeed = spd*3;
......
public class Lion extends Mammal{
protected int timeSpentAsleep;
public Lion(){
super();
timeSpentAsleep = 24;
}
public Lion(String hb, String fd, String nm, int a, String integ, String gnd, int nol, int spd, double hgt, String fc, String loco, int tsa){
super(hb, fd, nm, a, integ, gnd, nol, spd, hgt, fc, loco);
timeSpentAsleep = tsa;
}
}
public class Parrot extends Bird{ public class Parrot extends Bird{
public Parrot(){
super();
}
public Parrot(String hb, String fd, String nm, int a, String integ, String gnd, int nol, int spd, double ws, double mig, String fc){ public Parrot(String hb, String fd, String nm, int a, String integ, String gnd, int nol, int spd, double ws, double mig, String fc){
super(hb, fd, nm, a, integ, gnd, nol, spd, ws, mig, fc); super(hb, fd, nm, a, integ, gnd, nol, spd, ws, mig, fc);
} }
......
import java.text.DecimalFormat;
public class RedPanda extends Mammal{
protected double homeRange; //the red panda is a pretty solitary animal that likes it's own space
protected static final DecimalFormat df = new DecimalFormat("0.00");
public RedPanda(){
super();
homeRange = 2.1;
}
public RedPanda(String hb, String fd, String nm, int a, String integ, String gnd, int nol, int spd, double hgt, String fc, String loco, double hora){
super(hb, fd, nm, a, integ, gnd, nol, spd, hgt, fc, loco);
homeRange = hora;
}
public void climbTree(){
System.out.println(this.name + " climbs " + df.format(this.speed) + " feet up a tree!");
}
}
abstract class Reptile extends Animal{
protected boolean amphibious;
protected double length;
public Reptile(){
super();
amphibious = true;
length = 32.5;
}
public Reptile(String hb, String fd, String nm, int a, String integ, String gnd, int nol, int spd, boolean amph, double len){
super(hb, fd, nm, a, integ, gnd, nol, spd);
amphibious = amph;
length = len;
}
}
public class Turtle extends Reptile{
protected String shellPattern;
public Turtle(){
super();
shellPattern = "Starry";
}
public Turtle(String hb, String fd, String nm, int a, String integ, String gnd, int nol, int spd, boolean amph, double len, String shpt){
super(hb, fd, nm, a, integ, gnd, nol, spd, amph, len);
shellPattern = shpt;
}
}
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