Commit aa036564 authored by jinny.wilkin's avatar jinny.wilkin

2 phylums 6 species complete

parents
abstract public class Animal{
protected String habitat;
protected String food;
protected String name;
protected int age;
protected String integument; //Scienctific word for fur/feathers/scales - skin stuff!
protected String gender;
protected int numOfLegs;
protected int speed;
public Animal(){
this.habitat = "zoo";
this.food = "ice cream";
this.name = "Default John";
this.age = 0;
this.integument = "Bald";
this.gender = "NB";
this.numOfLegs = 100;
this.speed = 20;
}
public Animal(String hb, String fd, String nm, int a, String integ, String gnd, int nol, int spd){
this.habitat = hb;
this.food = fd;
this.name = nm;
this.age = a;
this.integument = integ;
this.gender = gnd;
this.numOfLegs = nol;
this.speed = spd;
}
}
\ No newline at end of file
abstract class Bird extends Animal{
protected double wingSpan;
protected double migration;
protected String featherColour;
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);
this.wingSpan = ws;
this.migration = mig;
this.featherColour = fc;
}
public void flight(){
}
}
public class Catfish extends Fish{
protected double whiskerLength;
public Catfish(String hb, String fd, String nm, int a, String integ, String gnd, int nol, int spd, String culs, int md, int len, double wl){
super(hb, fd, nm, a, integ, gnd, nol, spd, culs, md, len);
whiskerLength = wl;
}
}
public class Duck extends Bird{
public Duck(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);
}
public void swim(){
System.out.println(this.name + "swims around the pond happily");
}
}
public class Emu extends Bird{
protected int runningSpeed;
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);
this.runningSpeed = spd*3;
}
}
abstract public class Fish extends Animal{
protected String Colourings;
protected int migrationDistance;
protected int length;
public Fish(String hb, String fd, String nm, int a, String integ, String gnd, int nol, int spd, String culs, int md, int len){
super(hb, fd, nm, a, integ, gnd, nol, spd);
Colourings = culs;
migrationDistance = md;
length = len;
}
}
abstract public class Mammal extends Animal{
protected double height;
protected String furColour;
protected String locomotion; //Do they vibe on two legs or four?
public Mammal(){
super();
height = 2.0f;
furColour = "nil";
locomotion = "wheels";
}
public Mammal(String hb, String fd, String nm, int a, String integ, String gnd, int nol, int spd, double hgt, String fc, String loco){
super(hb, fd, nm, a, integ, gnd, nol, spd);
height = hgt;
furColour = fc;
locomotion = loco;
}
}
public class Parrot extends Bird{
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);
}
public void mimicry(String input){
System.out.println("squark! " + input + " squark!");
}
}
public class PufferFish extends Fish{
protected boolean isExpanded = false;
public PufferFish(String hb, String fd, String nm, int a, String integ, String gnd, int nol, int spd, String culs, int md, int len){
super(hb, fd, nm, a, integ, gnd, nol, spd, culs, md, len);
}
public void expansion(){
isExpanded = !isExpanded;
}
}
public class Shark extends Fish{
protected int teeth;
public Shark(String hb, String fd, String nm, int a, String integ, String gnd, int nol, int spd, String culs, int md, int len, int tth){
super(hb, fd, nm, a, integ, gnd, nol, spd, culs, md, len);
teeth = tth;
}
}
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