Commit 84365613 authored by harry.sawdon's avatar harry.sawdon

second commit

parent 8fec08e3
package inheritanceTest; package inheritanceTest;
public class Animal { public class Animal {// defines custom class animal to set up inheritance system.
// definition of argument names and data types
protected String name; protected String name;
protected String enviro; protected String enviro;
protected String eats; protected String eats;
...@@ -13,7 +13,7 @@ public class Animal { ...@@ -13,7 +13,7 @@ public class Animal {
public Animal(){} public Animal(){}
public Animal(String Name, String habitat, String food, String legs, String wingspan, String length, String description){ public Animal(String Name, String habitat, String food, String legs, String wingspan, String length, String description){//assigns arguments to animal class and all extensions
this.name = Name; this.name = Name;
this.enviro = habitat; this.enviro = habitat;
this.eats = food; this.eats = food;
...@@ -22,7 +22,7 @@ public class Animal { ...@@ -22,7 +22,7 @@ public class Animal {
this.Length= length; this.Length= length;
this.Description = description; this.Description = description;
} }
// sets return parameters for each argument
public String getName() { public String getName() {
return name; return name;
} }
......
package inheritanceTest; package inheritanceTest;
public class Bird extends Animal{ public class Bird extends Animal{//defines bird class as extension of animal
public Bird(String Name, String habitat, String food, String legs, String wingspan, String length, String Description) { public Bird(String Name, String habitat, String food, String legs, String wingspan, String length, String Description) {
super(Name, habitat, food, legs, wingspan, length, Description); super(Name, habitat, food, legs, wingspan, length, Description);// provides arguments for bird type animal
} }
...@@ -12,7 +12,7 @@ public class Bird extends Animal{ ...@@ -12,7 +12,7 @@ public class Bird extends Animal{
@Override @Override
public String toString() { public String toString() {//forces all args to return a string data type(not really needed but a safety measure)
return name + enviro + eats + noOfLegs + wings + Length + Description; return name + enviro + eats + noOfLegs + wings + Length + Description;
} }
} }
...@@ -2,17 +2,17 @@ package inheritanceTest; ...@@ -2,17 +2,17 @@ package inheritanceTest;
public class Fish extends Animal{ public class Fish extends Animal{//defines fish class as extension of animal
public Fish(String Name, String habitat, String food, String legs, String wingspan, String length, String Description) { public Fish(String Name, String habitat, String food, String legs, String wingspan, String length, String Description) {
super(Name, habitat, food, legs, wingspan, length, Description); super(Name, habitat, food, legs, wingspan, length, Description);// provides arguments for fish type animal
} }
@Override @Override
public String toString() { public String toString() {//forces all args to return a string data type(not really needed but a safety measure)
return name + enviro + eats + noOfLegs + wings + Length + Description; return name + enviro + eats + noOfLegs + wings + Length + Description;
} }
} }
......
package inheritanceTest; package inheritanceTest;
public class Mammal extends Animal{ public class Mammal extends Animal{//defines mammal class as extension of animal
public Mammal(String Name, String habitat, String food, String legs, String wings, String length, String Description) { public Mammal(String Name, String habitat, String food, String legs, String wings, String length, String Description) {
super(Name, habitat, food, legs, wings, length, Description); super(Name, habitat, food, legs, wings, length, Description);// provides arguments for mammal type animal
} }
@Override @Override
public String toString() { public String toString() {//forces all args to return a string data type(not really needed but a safety measure)
return name + enviro + eats + noOfLegs + wings + Length + Description; return name + enviro + eats + noOfLegs + wings + Length + Description;
} }
......
package inheritanceTest; package inheritanceTest;
public class Reptile extends Animal{ public class Reptile extends Animal{//defines reptile class as extension of animal
public Reptile(String Name, String habitat, String food, String legs, String wingspan, String length, String Description) { public Reptile(String Name, String habitat, String food, String legs, String wingspan, String length, String Description) {
super(Name, habitat, food, legs, wingspan, length, Description); super(Name, habitat, food, legs, wingspan, length, Description);// provides arguments for reptile type animal
} }
@Override @Override
public String toString() { public String toString() {//forces all args to return a string data type(not really needed but a safety measure)
return name + enviro + eats + noOfLegs + wings + Length + Description; return name + enviro + eats + noOfLegs + wings + Length + Description;
} }
......
package inheritanceTest; package inheritanceTest;//importing utilities needed for this program
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Random; import java.util.Random;
import java.util.Scanner; import java.util.Scanner;
public class Test { public class Test { //collective class corresponding to file name
public static void animals() { public static void animals() {//class for all animals
ArrayList<Animal> Animals = new ArrayList<Animal>(); ArrayList<Animal> Animals = new ArrayList<Animal>();//initialise arraylist for all animals
//defining all animals and their features
Mammal PBear = new Mammal("Name: Polar Bear\n","Habitat: Arctic\n","Eats: Seals\n","4 Legs\n", "Polar Bears are large white bears that live in the Arctic.\nThey are carnivores and often search in the water for seals to hunt.\n", " ", ""); Mammal PBear = new Mammal("Name: Polar Bear\n","Habitat: Arctic\n","Eats: Seals\n","4 Legs\n", "Polar Bears are large white bears that live in the Arctic.\nThey are carnivores and often search in the water for seals to hunt.\n", " ", "");
Mammal Seal = new Mammal("Name: Seal\n", "Habitat: Arctic\n", "Eats: Fish\n", "2 Legs\n", "Seals are large aquatic mammals that live in the arctic and antarctic\nThey live in the sea primarily and often hunt schools of fish.\n", "", ""); Mammal Seal = new Mammal("Name: Seal\n", "Habitat: Arctic\n", "Eats: Fish\n", "2 Legs\n", "Seals are large aquatic mammals that live in the arctic and antarctic\nThey live in the sea primarily and often hunt schools of fish.\n", "", "");
Mammal Camel = new Mammal("Name: Camel\n", "Habitat: Desert\n", "Eats: Plants\n", "4 Legs\n", "Camels are desert mammals that exist in worldwide deserts.\nThey eat dry vegetation and plants in the environment.\n", "", ""); Mammal Camel = new Mammal("Name: Camel\n", "Habitat: Desert\n", "Eats: Plants\n", "4 Legs\n", "Camels are desert mammals that exist in worldwide deserts.\nThey eat dry vegetation and plants in the environment.\n", "", "");
...@@ -39,12 +39,12 @@ public class Test { ...@@ -39,12 +39,12 @@ public class Test {
Reptile Python = new Reptile("Name: Python\n", "Habitat: Jungle/Swamps\n", "Eats: Small/Medium Mammals\n", "0 Legs\n", "Pythoins are a type of snake found in the jungle/swamp environments.\nThey feed on small to medium mammals local to their habitat.\n", "", ""); Reptile Python = new Reptile("Name: Python\n", "Habitat: Jungle/Swamps\n", "Eats: Small/Medium Mammals\n", "0 Legs\n", "Pythoins are a type of snake found in the jungle/swamp environments.\nThey feed on small to medium mammals local to their habitat.\n", "", "");
Reptile Lizard = new Reptile("Name: Common Lizard\n", "Habitat: All Habitats\n", "Eats: Insects\n", "4 Legs\n", "The common lizard can be found in many environments worldwide.\nThey feed on small insects from all environments.\n", "", ""); Reptile Lizard = new Reptile("Name: Common Lizard\n", "Habitat: All Habitats\n", "Eats: Insects\n", "4 Legs\n", "The common lizard can be found in many environments worldwide.\nThey feed on small insects from all environments.\n", "", "");
Reptile Chameleon = new Reptile("Name: Chameleon\n", "Habitat: Rainforests\n", "Eats: Insects\n", "4 Legs\n", "Chameleons are known for their camouflage ability and are\nfound in rainforests. They feed on exotic bugs.\n", "", ""); Reptile Chameleon = new Reptile("Name: Chameleon\n", "Habitat: Rainforests\n", "Eats: Insects\n", "4 Legs\n", "Chameleons are known for their camouflage ability and are\nfound in rainforests. They feed on exotic bugs.\n", "", "");
//adding all animals into array
Animals.add(PBear);Animals.add(Seal);Animals.add(Camel);Animals.add(Coyote);Animals.add(Jaguar);Animals.add(Capybara);Animals.add(Deer);Animals.add(Raccoon); Animals.add(PBear);Animals.add(Seal);Animals.add(Camel);Animals.add(Coyote);Animals.add(Jaguar);Animals.add(Capybara);Animals.add(Deer);Animals.add(Raccoon);
Animals.add(Penguin);Animals.add(SnowOwl);Animals.add(Vulture);Animals.add(Falcon);Animals.add(Parrot);Animals.add(Toucan);Animals.add(Owl);Animals.add(Woodpecker); Animals.add(Penguin);Animals.add(SnowOwl);Animals.add(Vulture);Animals.add(Falcon);Animals.add(Parrot);Animals.add(Toucan);Animals.add(Owl);Animals.add(Woodpecker);
Animals.add(crab);Animals.add(Snailfish);Animals.add(Eel);Animals.add(Bullshark);Animals.add(Salmon);Animals.add(carp); Animals.add(crab);Animals.add(Snailfish);Animals.add(Eel);Animals.add(Bullshark);Animals.add(Salmon);Animals.add(carp);
Animals.add(Tortoise);Animals.add(BDragon);Animals.add(Crocodile);Animals.add(Python);Animals.add(Lizard);Animals.add(Chameleon); Animals.add(Tortoise);Animals.add(BDragon);Animals.add(Crocodile);Animals.add(Python);Animals.add(Lizard);Animals.add(Chameleon);
// loop iterates through the array to print all elements upon request
for (int i = 0; i<Animals.size(); i++) { for (int i = 0; i<Animals.size(); i++) {
System.out.println(Animals.get(i)); System.out.println(Animals.get(i));
} }
...@@ -87,7 +87,7 @@ public class Test { ...@@ -87,7 +87,7 @@ public class Test {
Animals.add(Penguin);Animals.add(SnowOwl);Animals.add(Vulture);Animals.add(Falcon);Animals.add(Parrot);Animals.add(Toucan);Animals.add(Owl);Animals.add(Woodpecker); Animals.add(Penguin);Animals.add(SnowOwl);Animals.add(Vulture);Animals.add(Falcon);Animals.add(Parrot);Animals.add(Toucan);Animals.add(Owl);Animals.add(Woodpecker);
Animals.add(crab);Animals.add(Snailfish);Animals.add(Eel);Animals.add(Bullshark);Animals.add(Salmon);Animals.add(carp); Animals.add(crab);Animals.add(Snailfish);Animals.add(Eel);Animals.add(Bullshark);Animals.add(Salmon);Animals.add(carp);
Animals.add(Tortoise);Animals.add(BDragon);Animals.add(Crocodile);Animals.add(Python);Animals.add(Lizard);Animals.add(Chameleon); Animals.add(Tortoise);Animals.add(BDragon);Animals.add(Crocodile);Animals.add(Python);Animals.add(Lizard);Animals.add(Chameleon);
//picks a random number which corresponds to a selection within the array that sends a single animal's details to be printed
Random rand = new Random(); Random rand = new Random();
int upperbound = 28; int upperbound = 28;
...@@ -99,7 +99,7 @@ public class Test { ...@@ -99,7 +99,7 @@ public class Test {
public static void Mammals(){ public static void Mammals(){
ArrayList<Animal> Mammals = new ArrayList<Animal>(); ArrayList<Animal> Mammals = new ArrayList<Animal>();//arraylist definition for mammals
Mammal PBear = new Mammal("Name: Polar Bear\n","Habitat: Arctic\n","Eats: Seals\n","4 Legs\n", "Polar Bears are large white bears that live in the Arctic.\nThey are carnivores and often search in the water for seals to hunt.\n", " ", ""); Mammal PBear = new Mammal("Name: Polar Bear\n","Habitat: Arctic\n","Eats: Seals\n","4 Legs\n", "Polar Bears are large white bears that live in the Arctic.\nThey are carnivores and often search in the water for seals to hunt.\n", " ", "");
Mammal Seal = new Mammal("Name: Seal\n", "Habitat: Arctic\n", "Eats: Fish\n", "2 Legs\n", "Seals are large aquatic mammals that live in the arctic and antarctic\nThey live in the sea primarily and often hunt schools of fish.\n", "", ""); Mammal Seal = new Mammal("Name: Seal\n", "Habitat: Arctic\n", "Eats: Fish\n", "2 Legs\n", "Seals are large aquatic mammals that live in the arctic and antarctic\nThey live in the sea primarily and often hunt schools of fish.\n", "", "");
...@@ -127,7 +127,7 @@ public class Test { ...@@ -127,7 +127,7 @@ public class Test {
public static void birds() { public static void birds() {
ArrayList<Animal> Bird = new ArrayList<Animal>(); ArrayList<Animal> Bird = new ArrayList<Animal>();//arraylist definition for birds
Bird Penguin = new Bird("Name: Penguin\n", "Habitat: Antarctic\n","Eats: Sealife\n","2 Legs\n", "Wingspan: 30in\n", "Penguins are large Antarctic birds that come in many forms.\nThey feed on fish in their envornment.\n", ""); Bird Penguin = new Bird("Name: Penguin\n", "Habitat: Antarctic\n","Eats: Sealife\n","2 Legs\n", "Wingspan: 30in\n", "Penguins are large Antarctic birds that come in many forms.\nThey feed on fish in their envornment.\n", "");
Bird SnowOwl = new Bird("Name: Snow Owl\n", "Habitat: Arctic\n", "Eats: Lemmings/Small Animals\n", "2 Legs\n", "Wingspan: 165cm\n", "Snow Owls are small owls that live in the arctic\nThey feed on lemmings and small rodents.\n", ""); Bird SnowOwl = new Bird("Name: Snow Owl\n", "Habitat: Arctic\n", "Eats: Lemmings/Small Animals\n", "2 Legs\n", "Wingspan: 165cm\n", "Snow Owls are small owls that live in the arctic\nThey feed on lemmings and small rodents.\n", "");
...@@ -155,7 +155,7 @@ public class Test { ...@@ -155,7 +155,7 @@ public class Test {
public static void fish() { public static void fish() {
ArrayList<Animal> Fishes = new ArrayList<Animal>(); ArrayList<Animal> Fishes = new ArrayList<Animal>();//arraylist definition for fish
Fish crab = new Fish("Name: Crab\n", "Habitat: All Environments\n", "Eats: Carcasses/Plants\n", "10 Legs\n", "Length: Between 10cm - 2m\n", "Crabs are all-environment crustaceans that scavenge\nfor fish carcasses and plants in their environment\n", ""); Fish crab = new Fish("Name: Crab\n", "Habitat: All Environments\n", "Eats: Carcasses/Plants\n", "10 Legs\n", "Length: Between 10cm - 2m\n", "Crabs are all-environment crustaceans that scavenge\nfor fish carcasses and plants in their environment\n", "");
Fish Snailfish = new Fish("Name: Snailfish\n", "Habitat: Cold Water\n", "Eats: Crustaceans\n", "Length: 30cm\n", "Snailfish are cold water fish that are often found in\ncolder climates. they feed on crustaceans.\n", "", ""); Fish Snailfish = new Fish("Name: Snailfish\n", "Habitat: Cold Water\n", "Eats: Crustaceans\n", "Length: 30cm\n", "Snailfish are cold water fish that are often found in\ncolder climates. they feed on crustaceans.\n", "", "");
...@@ -178,7 +178,7 @@ public class Test { ...@@ -178,7 +178,7 @@ public class Test {
public static void reptiles() { public static void reptiles() {
ArrayList<Animal> Reptiles = new ArrayList<Animal>(); ArrayList<Animal> Reptiles = new ArrayList<Animal>();//arraylist definition for reptiles
Reptile Tortoise = new Reptile("Name: Tortoise\n", "Habitat: Deserts\n", "Eats: Plants/Vegetation\n", "4 Legs\n", "Tortoises are large, shelled reptiles that live a long time.\nThey feed on desert plants and vegatation.\n", "", ""); Reptile Tortoise = new Reptile("Name: Tortoise\n", "Habitat: Deserts\n", "Eats: Plants/Vegetation\n", "4 Legs\n", "Tortoises are large, shelled reptiles that live a long time.\nThey feed on desert plants and vegatation.\n", "", "");
Reptile BDragon = new Reptile("Name: Bearded Dragon\n", "Habitat: Deserts\n", "Eats: Plants/Insects\n", "4 Legs\n", "Bearded Dragons are medium sized, lizard type reptiles.\nThey feed on plants and insects in the desert environment.\n", "", ""); Reptile BDragon = new Reptile("Name: Bearded Dragon\n", "Habitat: Deserts\n", "Eats: Plants/Insects\n", "4 Legs\n", "Bearded Dragons are medium sized, lizard type reptiles.\nThey feed on plants and insects in the desert environment.\n", "", "");
...@@ -201,7 +201,7 @@ public class Test { ...@@ -201,7 +201,7 @@ public class Test {
} }
public static void desert() { public static void desert() {
ArrayList<Animal> Desert = new ArrayList<Animal>(); ArrayList<Animal> Desert = new ArrayList<Animal>();//arraylist definition for desert animals
Mammal Camel = new Mammal("Name: Camel\n", "Habitat: Desert\n", "Eats: Plants\n", "4 Legs\n", "Camels are desert mammals that exist in worldwide deserts.\nThey eat dry vegetation and plants in the environment.\n", "", ""); Mammal Camel = new Mammal("Name: Camel\n", "Habitat: Desert\n", "Eats: Plants\n", "4 Legs\n", "Camels are desert mammals that exist in worldwide deserts.\nThey eat dry vegetation and plants in the environment.\n", "", "");
Mammal Coyote = new Mammal("Name: Coyote\n", "Habitat: Desert\n", "Eats: Animals/Fruit\n", "4 Legs\n", "Coyotes are desert and plain animals that are typically feral.\nThey feed on other animals and fruit.\n", "", ""); Mammal Coyote = new Mammal("Name: Coyote\n", "Habitat: Desert\n", "Eats: Animals/Fruit\n", "4 Legs\n", "Coyotes are desert and plain animals that are typically feral.\nThey feed on other animals and fruit.\n", "", "");
Bird Vulture = new Bird("Name: Vulture\n", "Habitat: Desert\n", "Eats: Carcasses\n", "2 Legs\n", "Wingspan: 2.2m\n", "Vultures are large desert scavengers that feed\non dead animals due to their inability to hunt.\n", ""); Bird Vulture = new Bird("Name: Vulture\n", "Habitat: Desert\n", "Eats: Carcasses\n", "2 Legs\n", "Wingspan: 2.2m\n", "Vultures are large desert scavengers that feed\non dead animals due to their inability to hunt.\n", "");
...@@ -223,7 +223,7 @@ public class Test { ...@@ -223,7 +223,7 @@ public class Test {
} }
public static void arctic() { public static void arctic() {
ArrayList<Animal> Arctic = new ArrayList<Animal>(); ArrayList<Animal> Arctic = new ArrayList<Animal>();//arraylist definition for arctic animals
Mammal PBear = new Mammal("Name: Polar Bear\n","Habitat: Arctic\n","Eats: Seals\n","4 Legs\n", "Polar Bears are large white bears that live in the Arctic.\nThey are carnivores and often search in the water for seals to hunt.\n", " ", ""); Mammal PBear = new Mammal("Name: Polar Bear\n","Habitat: Arctic\n","Eats: Seals\n","4 Legs\n", "Polar Bears are large white bears that live in the Arctic.\nThey are carnivores and often search in the water for seals to hunt.\n", " ", "");
Mammal Seal = new Mammal("Name: Seal\n", "Habitat: Arctic\n", "Eats: Fish\n", "2 Legs\n", "Seals are large aquatic mammals that live in the arctic and antarctic\nThey live in the sea primarily and often hunt schools of fish.\n", "", ""); Mammal Seal = new Mammal("Name: Seal\n", "Habitat: Arctic\n", "Eats: Fish\n", "2 Legs\n", "Seals are large aquatic mammals that live in the arctic and antarctic\nThey live in the sea primarily and often hunt schools of fish.\n", "", "");
Fish Snailfish = new Fish("Name: Snailfish\n", "Habitat: Cold Water\n", "Eats: Crustaceans\n", "Length: 30cm\n", "Snailfish are cold water fish that are often found in\ncolder climates. they feed on crustaceans.\n", "", ""); Fish Snailfish = new Fish("Name: Snailfish\n", "Habitat: Cold Water\n", "Eats: Crustaceans\n", "Length: 30cm\n", "Snailfish are cold water fish that are often found in\ncolder climates. they feed on crustaceans.\n", "", "");
...@@ -242,7 +242,7 @@ public class Test { ...@@ -242,7 +242,7 @@ public class Test {
} }
public static void jungle() { public static void jungle() {
ArrayList<Animal> Jungle = new ArrayList<Animal>(); ArrayList<Animal> Jungle = new ArrayList<Animal>(); //arraylist definition for jungle animals
Mammal Jaguar = new Mammal("Name: Jaguar\n", "Habitat: Jungle/Rainforest\n", "Eats: Deer/Capybara\n", "4 Legs\n", "Jaguars are big cat predators that live in\njungle and rainforest environments.\n They feed on deer and capybara local to the environent.\n", "", ""); Mammal Jaguar = new Mammal("Name: Jaguar\n", "Habitat: Jungle/Rainforest\n", "Eats: Deer/Capybara\n", "4 Legs\n", "Jaguars are big cat predators that live in\njungle and rainforest environments.\n They feed on deer and capybara local to the environent.\n", "", "");
Mammal Capybara = new Mammal("Name: Capybara\n", "Habitat: Swamp/Grass\n", "Eats: Grass\n", "4 Legs\n", "Capybara are medium sized mammals that live in swampy and grassy areas.\nThey feed on grass primarily.\n", "", ""); Mammal Capybara = new Mammal("Name: Capybara\n", "Habitat: Swamp/Grass\n", "Eats: Grass\n", "4 Legs\n", "Capybara are medium sized mammals that live in swampy and grassy areas.\nThey feed on grass primarily.\n", "", "");
Bird Parrot = new Bird("Name: Parrot\n", "Habitat: Jungle/Rainforest\n", "Eats: Plants/Insects\n", "2 Legs\n", "Wingspan: 4ft\n", "Parrots are exotic birds that are\ntypically found in rainforest environments.\nThey feed on plants and insects.\n", ""); Bird Parrot = new Bird("Name: Parrot\n", "Habitat: Jungle/Rainforest\n", "Eats: Plants/Insects\n", "2 Legs\n", "Wingspan: 4ft\n", "Parrots are exotic birds that are\ntypically found in rainforest environments.\nThey feed on plants and insects.\n", "");
...@@ -263,7 +263,7 @@ public class Test { ...@@ -263,7 +263,7 @@ public class Test {
} }
public static void forestry() { public static void forestry() {
ArrayList<Animal> Forestry = new ArrayList<Animal>(); ArrayList<Animal> Forestry = new ArrayList<Animal>();//arraylist definition for forest animals
Mammal Deer = new Mammal("Name: Deer\n", "Habitat: Forestry, ", "Eats: Plants\n", "4 Legs\n", "Deer are worldwide animals that live in forest environments.\nThey are herbivores and thus feed on vegetation.\n", "", ""); Mammal Deer = new Mammal("Name: Deer\n", "Habitat: Forestry, ", "Eats: Plants\n", "4 Legs\n", "Deer are worldwide animals that live in forest environments.\nThey are herbivores and thus feed on vegetation.\n", "", "");
Mammal Raccoon = new Mammal("Name: Raccoon\n", "Habitat: Forestry\n", "Eats: Plants/Insects/Rodents\n", "4 Legs\n", "Raccoons live in forestry in several climates.\nThey feed on plants, insects and small rodents such as mice and shrews.\n", "", ""); Mammal Raccoon = new Mammal("Name: Raccoon\n", "Habitat: Forestry\n", "Eats: Plants/Insects/Rodents\n", "4 Legs\n", "Raccoons live in forestry in several climates.\nThey feed on plants, insects and small rodents such as mice and shrews.\n", "", "");
...@@ -281,7 +281,7 @@ public class Test { ...@@ -281,7 +281,7 @@ public class Test {
} }
public static void allenviro() { public static void allenviro() {
ArrayList<Animal> AllHabs = new ArrayList<Animal>(); ArrayList<Animal> AllHabs = new ArrayList<Animal>();//arraylist definition for animals from all environments
Reptile Lizard = new Reptile("Name: Common Lizard\n", "Habitat: All Habitats\n", "Eats: Insects\n", "4 Legs\n", "The common lizard can be found in many environments worldwide.\nThey feed on small insects from all environments.\n", "", ""); Reptile Lizard = new Reptile("Name: Common Lizard\n", "Habitat: All Habitats\n", "Eats: Insects\n", "4 Legs\n", "The common lizard can be found in many environments worldwide.\nThey feed on small insects from all environments.\n", "", "");
Fish crab = new Fish("Name: Crab\n", "Habitat: All Environments\n", "Eats: Carcasses/Plants\n", "10 Legs\n", "Length: Between 10cm - 2m\n", "Crabs are all-environment crustaceans that scavenge\nfor fish carcasses and plants in their environment\n", ""); Fish crab = new Fish("Name: Crab\n", "Habitat: All Environments\n", "Eats: Carcasses/Plants\n", "10 Legs\n", "Length: Between 10cm - 2m\n", "Crabs are all-environment crustaceans that scavenge\nfor fish carcasses and plants in their environment\n", "");
...@@ -303,7 +303,7 @@ public class Test { ...@@ -303,7 +303,7 @@ public class Test {
} }
public static void carnivore() { public static void carnivore() {
ArrayList<Animal> Carnivores = new ArrayList<Animal>(); ArrayList<Animal> Carnivores = new ArrayList<Animal>(); //arraylist definition for carnivores
Fish Snailfish = new Fish("Name: Snailfish\n", "Habitat: Cold Water\n", "Eats: Crustaceans\n", "Length: 30cm\n", "Snailfish are cold water fish that are often found in\ncolder climates. they feed on crustaceans.\n", "", ""); Fish Snailfish = new Fish("Name: Snailfish\n", "Habitat: Cold Water\n", "Eats: Crustaceans\n", "Length: 30cm\n", "Snailfish are cold water fish that are often found in\ncolder climates. they feed on crustaceans.\n", "", "");
Fish Eel = new Fish("Name: Eel\n", "Habitat: All Environments, Bottom Dwellers\n", "Eats: Small fish\n", "Length: 70cm\n", "Eels are bottom dweller fish found in all environments.\nThey feed on small fish and plants\n", "", ""); Fish Eel = new Fish("Name: Eel\n", "Habitat: All Environments, Bottom Dwellers\n", "Eats: Small fish\n", "Length: 70cm\n", "Eels are bottom dweller fish found in all environments.\nThey feed on small fish and plants\n", "", "");
Fish Bullshark = new Fish("Name: Bull Shark\n", "Habitat: Warm, shallow water\n", "Eats: All sealife\n", "Length: 11 feet\n", "Bull Shark are predators typically found in warm, shallow water\nand feed on all types of sealife from small to larger fish and other sharks.\n", "", ""); Fish Bullshark = new Fish("Name: Bull Shark\n", "Habitat: Warm, shallow water\n", "Eats: All sealife\n", "Length: 11 feet\n", "Bull Shark are predators typically found in warm, shallow water\nand feed on all types of sealife from small to larger fish and other sharks.\n", "", "");
...@@ -340,7 +340,7 @@ public class Test { ...@@ -340,7 +340,7 @@ public class Test {
} }
public static void herbivore() { public static void herbivore() {
ArrayList<Animal> Herbivores = new ArrayList<Animal>(); ArrayList<Animal> Herbivores = new ArrayList<Animal>(); //arraylist definition for herbivores
Reptile Tortoise = new Reptile("Name: Tortoise\n", "Habitat: Deserts\n", "Eats: Plants/Vegetation\n", "4 Legs\n", "Tortoises are large, shelled reptiles that live a long time.\nThey feed on desert plants and vegatation.\n", "", ""); Reptile Tortoise = new Reptile("Name: Tortoise\n", "Habitat: Deserts\n", "Eats: Plants/Vegetation\n", "4 Legs\n", "Tortoises are large, shelled reptiles that live a long time.\nThey feed on desert plants and vegatation.\n", "", "");
Reptile BDragon = new Reptile("Name: Bearded Dragon\n", "Habitat: Deserts\n", "Eats: Plants/Insects\n", "4 Legs\n", "Bearded Dragons are medium sized, lizard type reptiles.\nThey feed on plants and insects in the desert environment.\n", "", ""); Reptile BDragon = new Reptile("Name: Bearded Dragon\n", "Habitat: Deserts\n", "Eats: Plants/Insects\n", "4 Legs\n", "Bearded Dragons are medium sized, lizard type reptiles.\nThey feed on plants and insects in the desert environment.\n", "", "");
...@@ -358,7 +358,7 @@ public class Test { ...@@ -358,7 +358,7 @@ public class Test {
} }
public static void otherdiet() { public static void otherdiet() {
ArrayList<Animal> Otherdiets = new ArrayList<Animal>(); ArrayList<Animal> Otherdiets = new ArrayList<Animal>(); //arraylist definition for animals with varied diets
Reptile Lizard = new Reptile("Name: Common Lizard\n", "Habitat: All Habitats\n", "Eats: Insects\n", "4 Legs\n", "The common lizard can be found in many environments worldwide.\nThey feed on small insects from all environments.\n", "", ""); Reptile Lizard = new Reptile("Name: Common Lizard\n", "Habitat: All Habitats\n", "Eats: Insects\n", "4 Legs\n", "The common lizard can be found in many environments worldwide.\nThey feed on small insects from all environments.\n", "", "");
Reptile Chameleon = new Reptile("Name: Chameleon\n", "Habitat: Rainforests\n", "Eats: Insects\n", "4 Legs\n", "Chameleons are known for their camouflage ability and are\nfound in rainforests. They feed on exotic bugs.\n", "", ""); Reptile Chameleon = new Reptile("Name: Chameleon\n", "Habitat: Rainforests\n", "Eats: Insects\n", "4 Legs\n", "Chameleons are known for their camouflage ability and are\nfound in rainforests. They feed on exotic bugs.\n", "", "");
...@@ -387,11 +387,11 @@ public class Test { ...@@ -387,11 +387,11 @@ public class Test {
} }
} }
public static void main (String[] args) { public static void main (String[] args) {// main method
Scanner in = new Scanner(System.in);
Scanner in = new Scanner(System.in);// scanner 'in' to search for user input
// formatting the manu shown to the user
System.out.print("Welcome to YSJ Zoo! Please select an option to get started.\n\n"); System.out.print("Welcome to YSJ Zoo! Please select an option to get started.\n\n");
System.out.println("1\t Show all of our animals"); System.out.println("1\t Show all of our animals");
System.out.println("2\t Choose a random animal and show their details"); System.out.println("2\t Choose a random animal and show their details");
...@@ -410,11 +410,11 @@ public static void main (String[] args) { ...@@ -410,11 +410,11 @@ public static void main (String[] args) {
System.out.println("Please enter your choice:"); System.out.println("Please enter your choice:");
// takes user choice as an integer and stores it in 'choice'
int choice=in.nextInt(); int choice=in.nextInt();
switch (choice) { switch (choice) {// switch to facilitate a selection from the menu for any of the 14 options
case 1: case 1:
...@@ -500,12 +500,12 @@ case 14: ...@@ -500,12 +500,12 @@ case 14:
break; break;
default: default:// default return case in case of invalid entry
System.out.print("Invalid selection, please reload and try again"); System.out.print("Invalid selection, please reload and try again");
} }
in.close(); in.close();// close scanner
} }
......
package inheritanceTest;
import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;
public class test1 {
public static void animals() {
ArrayList<Animal> Animals = new ArrayList<Animal>();
Mammal PBear = new Mammal("Name: Polar Bear\n","Habitat: Arctic\n","Eats: Seals\n","4 Legs\n", "Polar Bears are large white bears that live in the Arctic.\nThey are carnivores and often search in the water for seals to hunt.\n", " ", "");
Mammal Seal = new Mammal("Name: Seal\n", "Habitat: Arctic\n", "Eats: Fish\n", "2 Legs\n", "Seals are large aquatic mammals that live in the arctic and antarctic\nThey live in the sea primarily and often hunt schools of fish.\n", "", "");
Mammal Camel = new Mammal("Name: Camel\n", "Habitat: Desert\n", "Eats: Plants\n", "4 Legs\n", "Camels are desert mammals that exist in worldwide deserts.\nThey eat dry vegetation and plants in the environment.\n", "", "");
Mammal Coyote = new Mammal("Name: Coyote\n", "Habitat: Desert\n", "Eats: Animals/Fruit\n", "4 Legs\n", "Coyotes are desert and plain animals that are typically feral.\nThey feed on other animals and fruit.\n", "", "");
Mammal Jaguar = new Mammal("Name: Jaguar\n", "Habitat: Jungle/Rainforest\n", "Eats: Deer/Capybara\n", "4 Legs\n", "Jaguars are big cat predators that live in\njungle and rainforest environments.\n They feed on deer and capybara local to the environent.\n", "", "");
Mammal Capybara = new Mammal("Name: Capybara\n", "Habitat: Swamp/Grass\n", "Eats: Grass\n", "4 Legs\n", "Capybara are medium sized mammals that live in swampy and grassy areas.\nThey feed on grass primarily.\n", "", "");
Mammal Deer = new Mammal("Name: Deer\n", "Habitat: Forestry, ", "Eats: Plants\n", "4 Legs\n", "Deer are worldwide animals that live in forest environments.\nThey are herbivores and thus feed on vegetation.\n", "", "");
Mammal Raccoon = new Mammal("Name: Raccoon\n", "Habitat: Forestry\n", "Eats: Plants/Insects/Rodents\n", "4 Legs\n", "Raccoons live in forestry in several climates.\nThey feed on plants, insects and small rodents such as mice and shrews.\n", "", "");
Bird Penguin = new Bird("Name: Penguin\n", "Habitat: Antarctic\n","Eats: Sealife\n","2 Legs\n", "Wingspan: 30in\n", "Penguins are large Antarctic birds that come in many forms.\nThey feed on fish in their envornment.\n", "");
Bird SnowOwl = new Bird("Name: Snow Owl\n", "Habitat: Arctic\n", "Eats: Lemmings/Small Animals\n", "2 Legs\n", "Wingspan: 165cm\n", "Snow Owls are small owls that live in the arctic\nThey feed on lemmings and small rodents.\n", "");
Bird Vulture = new Bird("Name: Vulture\n", "Habitat: Desert\n", "Eats: Carcasses\n", "2 Legs\n", "Wingspan: 2.2m\n", "Vultures are large desert scavengers that feed\non dead animals due to their inability to hunt.\n", "");
Bird Falcon = new Bird("Name: Falcon\n", "Habitat: Desert\n", "Eats: Small Birds/Fish\n", "2 Legs\n", "Wingspan: 120cm\n", "Falcons are large birds of prey that come in many forms.\nThey feed on small birds and fish and can be found\nin many environments.\n", "");
Bird Parrot = new Bird("Name: Parrot\n", "Habitat: Jungle/Rainforest\n", "Eats: Plants/Insects\n", "2 Legs\n", "Wingspan: 4ft\n", "Parrots are exotic birds that are\ntypically found in rainforest environments.\nThey feed on plants and insects.\n", "");
Bird Toucan = new Bird("Name: Toucan\n", "Habitat: Jungle/Rainforest\n", "Eats: Plants/Insects/Rodents\n", "2 Legs\n", "Wingspan: 52in\n", "Toucans are exotic birds that live in the rainforest.\nThey are similar to parrots in diet and environment.\n", "");
Bird Owl= new Bird("Name: Owl\n", "Habitat: Forestry\n", "Eats: Insects\n", "2 Legs\n", "Wingspan: 35in\n", "Owls are worldwide birds that have many sub-classifications.\nThey eat insects and are predators for this reason.\n", "");
Bird Woodpecker = new Bird("Name: Woodpecker\n", "Habitat: Forestry\n", "Eats: Grubs/Insects\n", "2 Legs\n", "Wingspan: 28in\n", "Woodpeckers are worldwide birds that are known for their insect hunting method\nof pecking trees to attract insects\n", "");
Fish crab = new Fish("Name: Crab\n", "Habitat: All Environments\n", "Eats: Carcasses/Plants\n", "10 Legs\n", "Length: Between 10cm - 2m\n", "Crabs are all-environment crustaceans that scavenge\nfor fish carcasses and plants in their environment\n", "");
Fish Snailfish = new Fish("Name: Snailfish\n", "Habitat: Cold Water\n", "Eats: Crustaceans\n", "Length: 30cm\n", "Snailfish are cold water fish that are often found in\ncolder climates. they feed on crustaceans.\n", "", "");
Fish Eel = new Fish("Name: Eel\n", "Habitat: All Environments, Bottom Dwellers\n", "Eats: Small fish\n", "Length: 70cm\n", "Eels are bottom dweller fish found in all environments.\nThey feed on small fish and plants\n", "", "");
Fish Bullshark = new Fish("Name: Bull Shark\n", "Habitat: Warm, shallow water\n", "Eats: All sealife\n", "Length: 11 feet\n", "Bull Shark are predators typically found in warm, shallow water\nand feed on all types of sealife from small to larger fish and other sharks.\n", "", "");
Fish Salmon = new Fish("Name: Salmon\n", "Habitat: Clear rivers\n", "Eats: Invertebrates/Small fish\n", "Length: Up to 30in\n", "Salmon are common fish found in clearwater rivers.\nThey feed on invertebrates and small fish also found in their habitat\n", "", "");
Fish carp = new Fish("Name: Carp\n", "Habitat: Lakes, Rivers\n", "Eats: Dead fish/Crustaceans\n", "Length: 60cm\n", "Carp are common fish that are found in lakes andrivers.\nThey feed mainly on dead fish and crustaceans.\n", "", "");
Reptile Tortoise = new Reptile("Name: Tortoise\n", "Habitat: Deserts\n", "Eats: Plants/Vegetation\n", "4 Legs\n", "Tortoises are large, shelled reptiles that live a long time.\nThey feed on desert plants and vegatation.\n", "", "");
Reptile BDragon = new Reptile("Name: Bearded Dragon\n", "Habitat: Deserts\n", "Eats: Plants/Insects\n", "4 Legs\n", "Bearded Dragons are medium sized, lizard type reptiles.\nThey feed on plants and insects in the desert environment.\n", "", "");
Reptile Crocodile = new Reptile("Name: Crocodile\n", "Habitat: Jungle/Swamps\n", "Eats: Small Animals\n", "4 Legs\n", "Crocodiles, related to alligators are jungle/swamp\ndwellers that feed on small to medium mammals.\n", "", "");
Reptile Python = new Reptile("Name: Python\n", "Habitat: Jungle/Swamps\n", "Eats: Small/Medium Mammals\n", "0 Legs\n", "Pythoins are a type of snake found in the jungle/swamp environments.\nThey feed on small to medium mammals local to their habitat.\n", "", "");
Reptile Lizard = new Reptile("Name: Common Lizard\n", "Habitat: All Habitats\n", "Eats: Insects\n", "4 Legs\n", "The common lizard can be found in many environments worldwide.\nThey feed on small insects from all environments.\n", "", "");
Reptile Chameleon = new Reptile("Name: Chameleon\n", "Habitat: Rainforests\n", "Eats: Insects\n", "4 Legs\n", "Chameleons are known for their camouflage ability and are\nfound in rainforests. They feed on exotic bugs.\n", "", "");
Animals.add(PBear);Animals.add(Seal);Animals.add(Camel);Animals.add(Coyote);Animals.add(Jaguar);Animals.add(Capybara);Animals.add(Deer);Animals.add(Raccoon);
Animals.add(Penguin);Animals.add(SnowOwl);Animals.add(Vulture);Animals.add(Falcon);Animals.add(Parrot);Animals.add(Toucan);Animals.add(Owl);Animals.add(Woodpecker);
Animals.add(crab);Animals.add(Snailfish);Animals.add(Eel);Animals.add(Bullshark);Animals.add(Salmon);Animals.add(carp);
Animals.add(Tortoise);Animals.add(BDragon);Animals.add(Crocodile);Animals.add(Python);Animals.add(Lizard);Animals.add(Chameleon);
for (int i = 0; i<Animals.size(); i++) {
System.out.println(Animals.get(i));
}
}
public static void animalsrand() {
ArrayList<Animal> Animals = new ArrayList<Animal>();
Mammal PBear = new Mammal("Name: Polar Bear\n","Habitat: Arctic\n","Eats: Seals\n","4 Legs\n", "Polar Bears are large white bears that live in the Arctic.\nThey are carnivores and often search in the water for seals to hunt.\n", " ", "");
Mammal Seal = new Mammal("Name: Seal\n", "Habitat: Arctic\n", "Eats: Fish\n", "2 Legs\n", "Seals are large aquatic mammals that live in the arctic and antarctic\nThey live in the sea primarily and often hunt schools of fish.\n", "", "");
Mammal Camel = new Mammal("Name: Camel\n", "Habitat: Desert\n", "Eats: Plants\n", "4 Legs\n", "Camels are desert mammals that exist in worldwide deserts.\nThey eat dry vegetation and plants in the environment.\n", "", "");
Mammal Coyote = new Mammal("Name: Coyote\n", "Habitat: Desert\n", "Eats: Animals/Fruit\n", "4 Legs\n", "Coyotes are desert and plain animals that are typically feral.\nThey feed on other animals and fruit.\n", "", "");
Mammal Jaguar = new Mammal("Name: Jaguar\n", "Habitat: Jungle/Rainforest\n", "Eats: Deer/Capybara\n", "4 Legs\n", "Jaguars are big cat predators that live in\njungle and rainforest environments.\n They feed on deer and capybara local to the environent.\n", "", "");
Mammal Capybara = new Mammal("Name: Capybara\n", "Habitat: Swamp/Grass\n", "Eats: Grass\n", "4 Legs\n", "Capybara are medium sized mammals that live in swampy and grassy areas.\nThey feed on grass primarily.\n", "", "");
Mammal Deer = new Mammal("Name: Deer\n", "Habitat: Forestry, ", "Eats: Plants\n", "4 Legs\n", "Deer are worldwide animals that live in forest environments.\nThey are herbivores and thus feed on vegetation.\n", "", "");
Mammal Raccoon = new Mammal("Name: Raccoon\n", "Habitat: Forestry\n", "Eats: Plants/Insects/Rodents\n", "4 Legs\n", "Raccoons live in forestry in several climates.\nThey feed on plants, insects and small rodents such as mice and shrews.\n", "", "");
Bird Penguin = new Bird("Name: Penguin\n", "Habitat: Antarctic\n","Eats: Sealife\n","2 Legs\n", "Wingspan: 30in\n", "Penguins are large Antarctic birds that come in many forms.\nThey feed on fish in their envornment.\n", "");
Bird SnowOwl = new Bird("Name: Snow Owl\n", "Habitat: Arctic\n", "Eats: Lemmings/Small Animals\n", "2 Legs\n", "Wingspan: 165cm\n", "Snow Owls are small owls that live in the arctic\nThey feed on lemmings and small rodents.\n", "");
Bird Vulture = new Bird("Name: Vulture\n", "Habitat: Desert\n", "Eats: Carcasses\n", "2 Legs\n", "Wingspan: 2.2m\n", "Vultures are large desert scavengers that feed\non dead animals due to their inability to hunt.\n", "");
Bird Falcon = new Bird("Name: Falcon\n", "Habitat: Desert\n", "Eats: Small Birds/Fish\n", "2 Legs\n", "Wingspan: 120cm\n", "Falcons are large birds of prey that come in many forms.\nThey feed on small birds and fish and can be found\nin many environments.\n", "");
Bird Parrot = new Bird("Name: Parrot\n", "Habitat: Jungle/Rainforest\n", "Eats: Plants/Insects\n", "2 Legs\n", "Wingspan: 4ft\n", "Parrots are exotic birds that are\ntypically found in rainforest environments.\nThey feed on plants and insects.\n", "");
Bird Toucan = new Bird("Name: Toucan\n", "Habitat: Jungle/Rainforest\n", "Eats: Plants/Insects/Rodents\n", "2 Legs\n", "Wingspan: 52in\n", "Toucans are exotic birds that live in the rainforest.\nThey are similar to parrots in diet and environment.\n", "");
Bird Owl= new Bird("Name: Owl\n", "Habitat: Forestry\n", "Eats: Insects\n", "2 Legs\n", "Wingspan: 35in\n", "Owls are worldwide birds that have many sub-classifications.\nThey eat insects and are predators for this reason.\n", "");
Bird Woodpecker = new Bird("Name: Woodpecker\n", "Habitat: Forestry\n", "Eats: Grubs/Insects\n", "2 Legs\n", "Wingspan: 28in\n", "Woodpeckers are worldwide birds that are known for their insect hunting method\nof pecking trees to attract insects\n", "");
Fish crab = new Fish("Name: Crab\n", "Habitat: All Environments\n", "Eats: Carcasses/Plants\n", "10 Legs\n", "Length: Between 10cm - 2m\n", "Crabs are all-environment crustaceans that scavenge\nfor fish carcasses and plants in their environment\n", "");
Fish Snailfish = new Fish("Name: Snailfish\n", "Habitat: Cold Water\n", "Eats: Crustaceans\n", "Length: 30cm\n", "Snailfish are cold water fish that are often found in\ncolder climates. they feed on crustaceans.\n", "", "");
Fish Eel = new Fish("Name: Eel\n", "Habitat: All Environments, Bottom Dwellers\n", "Eats: Small fish\n", "Length: 70cm\n", "Eels are bottom dweller fish found in all environments.\nThey feed on small fish and plants\n", "", "");
Fish Bullshark = new Fish("Name: Bull Shark\n", "Habitat: Warm, shallow water\n", "Eats: All sealife\n", "Length: 11 feet\n", "Bull Shark are predators typically found in warm, shallow water\nand feed on all types of sealife from small to larger fish and other sharks.\n", "", "");
Fish Salmon = new Fish("Name: Salmon\n", "Habitat: Clear rivers\n", "Eats: Invertebrates/Small fish\n", "Length: Up to 30in\n", "Salmon are common fish found in clearwater rivers.\nThey feed on invertebrates and small fish also found in their habitat\n", "", "");
Fish carp = new Fish("Name: Carp\n", "Habitat: Lakes, Rivers\n", "Eats: Dead fish/Crustaceans\n", "Length: 60cm\n", "Carp are common fish that are found in lakes andrivers.\nThey feed mainly on dead fish and crustaceans.\n", "", "");
Reptile Tortoise = new Reptile("Name: Tortoise\n", "Habitat: Deserts\n", "Eats: Plants/Vegetation\n", "4 Legs\n", "Tortoises are large, shelled reptiles that live a long time.\nThey feed on desert plants and vegatation.\n", "", "");
Reptile BDragon = new Reptile("Name: Bearded Dragon\n", "Habitat: Deserts\n", "Eats: Plants/Insects\n", "4 Legs\n", "Bearded Dragons are medium sized, lizard type reptiles.\nThey feed on plants and insects in the desert environment.\n", "", "");
Reptile Crocodile = new Reptile("Name: Crocodile\n", "Habitat: Jungle/Swamps\n", "Eats: Small Animals\n", "4 Legs\n", "Crocodiles, related to alligators are jungle/swamp\ndwellers that feed on small to medium mammals.\n", "", "");
Reptile Python = new Reptile("Name: Python\n", "Habitat: Jungle/Swamps\n", "Eats: Small/Medium Mammals\n", "0 Legs\n", "Pythoins are a type of snake found in the jungle/swamp environments.\nThey feed on small to medium mammals local to their habitat.\n", "", "");
Reptile Lizard = new Reptile("Name: Common Lizard\n", "Habitat: All Habitats\n", "Eats: Insects\n", "4 Legs\n", "The common lizard can be found in many environments worldwide.\nThey feed on small insects from all environments.\n", "", "");
Reptile Chameleon = new Reptile("Name: Chameleon\n", "Habitat: Rainforests\n", "Eats: Insects\n", "4 Legs\n", "Chameleons are known for their camouflage ability and are\nfound in rainforests. They feed on exotic bugs.\n", "", "");
Animals.add(PBear);Animals.add(Seal);Animals.add(Camel);Animals.add(Coyote);Animals.add(Jaguar);Animals.add(Capybara);Animals.add(Deer);Animals.add(Raccoon);
Animals.add(Penguin);Animals.add(SnowOwl);Animals.add(Vulture);Animals.add(Falcon);Animals.add(Parrot);Animals.add(Toucan);Animals.add(Owl);Animals.add(Woodpecker);
Animals.add(crab);Animals.add(Snailfish);Animals.add(Eel);Animals.add(Bullshark);Animals.add(Salmon);Animals.add(carp);
Animals.add(Tortoise);Animals.add(BDragon);Animals.add(Crocodile);Animals.add(Python);Animals.add(Lizard);Animals.add(Chameleon);
Random rand = new Random();
int upperbound = 28;
int pick = rand.nextInt(upperbound);
System.out.print(Animals.get(pick));
}
public static void Mammals(){
ArrayList<Animal> Mammals = new ArrayList<Animal>();
Mammal PBear = new Mammal("Name: Polar Bear\n","Habitat: Arctic\n","Eats: Seals\n","4 Legs\n", "Polar Bears are large white bears that live in the Arctic.\nThey are carnivores and often search in the water for seals to hunt.\n", " ", "");
Mammal Seal = new Mammal("Name: Seal\n", "Habitat: Arctic\n", "Eats: Fish\n", "2 Legs\n", "Seals are large aquatic mammals that live in the arctic and antarctic\nThey live in the sea primarily and often hunt schools of fish.\n", "", "");
Mammal Camel = new Mammal("Name: Camel\n", "Habitat: Desert\n", "Eats: Plants\n", "4 Legs\n", "Camels are desert mammals that exist in worldwide deserts.\nThey eat dry vegetation and plants in the environment.\n", "", "");
Mammal Coyote = new Mammal("Name: Coyote\n", "Habitat: Desert\n", "Eats: Animals/Fruit\n", "4 Legs\n", "Coyotes are desert and plain animals that are typically feral.\nThey feed on other animals and fruit.\n", "", "");
Mammal Jaguar = new Mammal("Name: Jaguar\n", "Habitat: Jungle/Rainforest\n", "Eats: Deer/Capybara\n", "4 Legs\n", "Jaguars are big cat predators that live in\njungle and rainforest environments.\n They feed on deer and capybara local to the environent.\n", "", "");
Mammal Capybara = new Mammal("Name: Capybara\n", "Habitat: Swamp/Grass\n", "Eats: Grass\n", "4 Legs\n", "Capybara are medium sized mammals that live in swampy and grassy areas.\nThey feed on grass primarily.\n", "", "");
Mammal Deer = new Mammal("Name: Deer\n", "Habitat: Forestry, ", "Eats: Plants\n", "4 Legs\n", "Deer are worldwide animals that live in forest environments.\nThey are herbivores and thus feed on vegetation.\n", "", "");
Mammal Raccoon = new Mammal("Name: Raccoon\n", "Habitat: Forestry\n", "Eats: Plants/Insects/Rodents\n", "4 Legs\n", "Raccoons live in forestry in several climates.\nThey feed on plants, insects and small rodents such as mice and shrews.\n", "", "");
Mammals.add(PBear);
Mammals.add(Seal);
Mammals.add(Camel);
Mammals.add(Coyote);
Mammals.add(Jaguar);
Mammals.add(Capybara);
Mammals.add(Deer);
Mammals.add(Raccoon);
for (int i = 0; i<Mammals.size(); i++) {
System.out.println(Mammals.get(i));
}
}
public static void birds() {
ArrayList<Animal> Bird = new ArrayList<Animal>();
Bird Penguin = new Bird("Name: Penguin\n", "Habitat: Antarctic\n","Eats: Sealife\n","2 Legs\n", "Wingspan: 30in\n", "Penguins are large Antarctic birds that come in many forms.\nThey feed on fish in their envornment.\n", "");
Bird SnowOwl = new Bird("Name: Snow Owl\n", "Habitat: Arctic\n", "Eats: Lemmings/Small Animals\n", "2 Legs\n", "Wingspan: 165cm\n", "Snow Owls are small owls that live in the arctic\nThey feed on lemmings and small rodents.\n", "");
Bird Vulture = new Bird("Name: Vulture\n", "Habitat: Desert\n", "Eats: Carcasses\n", "2 Legs\n", "Wingspan: 2.2m\n", "Vultures are large desert scavengers that feed\non dead animals due to their inability to hunt.\n", "");
Bird Falcon = new Bird("Name: Falcon\n", "Habitat: Desert\n", "Eats: Small Birds/Fish\n", "2 Legs\n", "Wingspan: 120cm\n", "Falcons are large birds of prey that come in many forms.\nThey feed on small birds and fish and can be found\nin many environments.\n", "");
Bird Parrot = new Bird("Name: Parrot\n", "Habitat: Jungle/Rainforest\n", "Eats: Plants/Insects\n", "2 Legs\n", "Wingspan: 4ft\n", "Parrots are exotic birds that are\ntypically found in rainforest environments.\nThey feed on plants and insects.\n", "");
Bird Toucan = new Bird("Name: Toucan\n", "Habitat: Jungle/Rainforest\n", "Eats: Plants/Insects/Rodents\n", "2 Legs\n", "Wingspan: 52in\n", "Toucans are exotic birds that live in the rainforest.\nThey are similar to parrots in diet and environment.\n", "");
Bird Owl= new Bird("Name: Owl\n", "Habitat: Forestry\n", "Eats: Insects\n", "2 Legs\n", "Wingspan: 35in\n", "Owls are worldwide birds that have many sub-classifications.\nThey eat insects and are predators for this reason.\n", "");
Bird Woodpecker = new Bird("Name: Woodpecker\n", "Habitat: Forestry\n", "Eats: Grubs/Insects\n", "2 Legs\n", "Wingspan: 28in\n", "Woodpeckers are worldwide birds that are known for their insect hunting method\nof pecking trees to attract insects\n", "");
Bird.add(Penguin);
Bird.add(SnowOwl);
Bird.add(Vulture);
Bird.add(Falcon);
Bird.add(Parrot);
Bird.add(Toucan);
Bird.add(Owl);
Bird.add(Woodpecker);
for (int i = 0; i<Bird.size(); i++) {
System.out.println(Bird.get(i));
}
}
public static void fish() {
ArrayList<Animal> Fishes = new ArrayList<Animal>();
Fish crab = new Fish("Name: Crab\n", "Habitat: All Environments\n", "Eats: Carcasses/Plants\n", "10 Legs\n", "Length: Between 10cm - 2m\n", "Crabs are all-environment crustaceans that scavenge\nfor fish carcasses and plants in their environment\n", "");
Fish Snailfish = new Fish("Name: Snailfish\n", "Habitat: Cold Water\n", "Eats: Crustaceans\n", "Length: 30cm\n", "Snailfish are cold water fish that are often found in\ncolder climates. they feed on crustaceans.\n", "", "");
Fish Eel = new Fish("Name: Eel\n", "Habitat: All Environments, Bottom Dwellers\n", "Eats: Small fish\n", "Length: 70cm\n", "Eels are bottom dweller fish found in all environments.\nThey feed on small fish and plants\n", "", "");
Fish Bullshark = new Fish("Name: Bull Shark\n", "Habitat: Warm, shallow water\n", "Eats: All sealife\n", "Length: 11 feet\n", "Bull Shark are predators typically found in warm, shallow water\nand feed on all types of sealife from small to larger fish and other sharks.\n", "", "");
Fish Salmon = new Fish("Name: Salmon\n", "Habitat: Clear rivers\n", "Eats: Invertebrates/Small fish\n", "Length: Up to 30in\n", "Salmon are common fish found in clearwater rivers.\nThey feed on invertebrates and small fish also found in their habitat\n", "", "");
Fish carp = new Fish("Name: Carp\n", "Habitat: Lakes, Rivers\n", "Eats: Dead fish/Crustaceans\n", "Length: 60cm\n", "Carp are common fish that are found in lakes andrivers.\nThey feed mainly on dead fish and crustaceans.\n", "", "");
Fishes.add(crab);
Fishes.add(Snailfish);
Fishes.add(Eel);
Fishes.add(Bullshark);
Fishes.add(Salmon);
Fishes.add(carp);
for (int i = 0; i<Fishes.size(); i++) {
System.out.println(Fishes.get(i));
}
}
public static void reptiles() {
ArrayList<Animal> Reptiles = new ArrayList<Animal>();
Reptile Tortoise = new Reptile("Name: Tortoise\n", "Habitat: Deserts\n", "Eats: Plants/Vegetation\n", "4 Legs\n", "Tortoises are large, shelled reptiles that live a long time.\nThey feed on desert plants and vegatation.\n", "", "");
Reptile BDragon = new Reptile("Name: Bearded Dragon\n", "Habitat: Deserts\n", "Eats: Plants/Insects\n", "4 Legs\n", "Bearded Dragons are medium sized, lizard type reptiles.\nThey feed on plants and insects in the desert environment.\n", "", "");
Reptile Crocodile = new Reptile("Name: Crocodile\n", "Habitat: Jungle/Swamps\n", "Eats: Small Animals\n", "4 Legs\n", "Crocodiles, related to alligators are jungle/swamp\ndwellers that feed on small to medium mammals.\n", "", "");
Reptile Python = new Reptile("Name: Python\n", "Habitat: Jungle/Swamps\n", "Eats: Small/Medium Mammals\n", "0 Legs\n", "Pythoins are a type of snake found in the jungle/swamp environments.\nThey feed on small to medium mammals local to their habitat.\n", "", "");
Reptile Lizard = new Reptile("Name: Common Lizard\n", "Habitat: All Habitats\n", "Eats: Insects\n", "4 Legs\n", "The common lizard can be found in many environments worldwide.\nThey feed on small insects from all environments.\n", "", "");
Reptile Chameleon = new Reptile("Name: Chameleon\n", "Habitat: Rainforests\n", "Eats: Insects\n", "4 Legs\n", "Chameleons are known for their camouflage ability and are\nfound in rainforests. They feed on exotic bugs.\n", "", "");
Reptiles.add(Tortoise);
Reptiles.add(BDragon);
Reptiles.add(Crocodile);
Reptiles.add(Python);
Reptiles.add(Lizard);
Reptiles.add(Chameleon);
for (int i = 0; i<Reptiles.size(); i++) {
System.out.println(Reptiles.get(i));
}
}
public static void desert() {
ArrayList<Animal> Desert = new ArrayList<Animal>();
Mammal Camel = new Mammal("Name: Camel\n", "Habitat: Desert\n", "Eats: Plants\n", "4 Legs\n", "Camels are desert mammals that exist in worldwide deserts.\nThey eat dry vegetation and plants in the environment.\n", "", "");
Mammal Coyote = new Mammal("Name: Coyote\n", "Habitat: Desert\n", "Eats: Animals/Fruit\n", "4 Legs\n", "Coyotes are desert and plain animals that are typically feral.\nThey feed on other animals and fruit.\n", "", "");
Bird Vulture = new Bird("Name: Vulture\n", "Habitat: Desert\n", "Eats: Carcasses\n", "2 Legs\n", "Wingspan: 2.2m\n", "Vultures are large desert scavengers that feed\non dead animals due to their inability to hunt.\n", "");
Bird Falcon = new Bird("Name: Falcon\n", "Habitat: Desert\n", "Eats: Small Birds/Fish\n", "2 Legs\n", "Wingspan: 120cm\n", "Falcons are large birds of prey that come in many forms.\nThey feed on small birds and fish and can be found\nin many environments.\n", "");
Reptile Tortoise = new Reptile("Name: Tortoise\n", "Habitat: Deserts\n", "Eats: Plants/Vegetation\n", "4 Legs\n", "Tortoises are large, shelled reptiles that live a long time.\nThey feed on desert plants and vegatation.\n", "", "");
Reptile BDragon = new Reptile("Name: Bearded Dragon\n", "Habitat: Deserts\n", "Eats: Plants/Insects\n", "4 Legs\n", "Bearded Dragons are medium sized, lizard type reptiles.\nThey feed on plants and insects in the desert environment.\n", "", "");
Desert.add(Camel);
Desert.add(Coyote);
Desert.add(Vulture);
Desert.add(Falcon);
Desert.add(Tortoise);
Desert.add(BDragon);
for (int i = 0; i<Desert.size(); i++) {
System.out.println(Desert.get(i));
}
}
public static void arctic() {
ArrayList<Animal> Arctic = new ArrayList<Animal>();
Mammal PBear = new Mammal("Name: Polar Bear\n","Habitat: Arctic\n","Eats: Seals\n","4 Legs\n", "Polar Bears are large white bears that live in the Arctic.\nThey are carnivores and often search in the water for seals to hunt.\n", " ", "");
Mammal Seal = new Mammal("Name: Seal\n", "Habitat: Arctic\n", "Eats: Fish\n", "2 Legs\n", "Seals are large aquatic mammals that live in the arctic and antarctic\nThey live in the sea primarily and often hunt schools of fish.\n", "", "");
Fish Snailfish = new Fish("Name: Snailfish\n", "Habitat: Cold Water\n", "Eats: Crustaceans\n", "Length: 30cm\n", "Snailfish are cold water fish that are often found in\ncolder climates. they feed on crustaceans.\n", "", "");
Bird Penguin = new Bird("Name: Penguin\n", "Habitat: Antarctic\n","Eats: Sealife\n","2 Legs\n", "Wingspan: 30in\n", "Penguins are large Antarctic birds that come in many forms.\nThey feed on fish in their envornment.\n", "");
Bird SnowOwl = new Bird("Name: Snow Owl\n", "Habitat: Arctic\n", "Eats: Lemmings/Small Animals\n", "2 Legs\n", "Wingspan: 165cm\n", "Snow Owls are small owls that live in the arctic\nThey feed on lemmings and small rodents.\n", "");
Arctic.add(PBear);
Arctic.add(Seal);
Arctic.add(Snailfish);
Arctic.add(Penguin);
Arctic.add(SnowOwl);
for (int i = 0; i<Arctic.size(); i++) {
System.out.println(Arctic.get(i));
}
}
public static void jungle() {
ArrayList<Animal> Jungle = new ArrayList<Animal>();
Mammal Jaguar = new Mammal("Name: Jaguar\n", "Habitat: Jungle/Rainforest\n", "Eats: Deer/Capybara\n", "4 Legs\n", "Jaguars are big cat predators that live in\njungle and rainforest environments.\n They feed on deer and capybara local to the environent.\n", "", "");
Mammal Capybara = new Mammal("Name: Capybara\n", "Habitat: Swamp/Grass\n", "Eats: Grass\n", "4 Legs\n", "Capybara are medium sized mammals that live in swampy and grassy areas.\nThey feed on grass primarily.\n", "", "");
Bird Parrot = new Bird("Name: Parrot\n", "Habitat: Jungle/Rainforest\n", "Eats: Plants/Insects\n", "2 Legs\n", "Wingspan: 4ft\n", "Parrots are exotic birds that are\ntypically found in rainforest environments.\nThey feed on plants and insects.\n", "");
Bird Toucan = new Bird("Name: Toucan\n", "Habitat: Jungle/Rainforest\n", "Eats: Plants/Insects/Rodents\n", "2 Legs\n", "Wingspan: 52in\n", "Toucans are exotic birds that live in the rainforest.\nThey are similar to parrots in diet and environment.\n", "");
Reptile Python = new Reptile("Name: Python\n", "Habitat: Jungle/Swamps\n", "Eats: Small/Medium Mammals\n", "0 Legs\n", "Pythoins are a type of snake found in the jungle/swamp environments.\nThey feed on small to medium mammals local to their habitat.\n", "", "");
Reptile Chameleon = new Reptile("Name: Chameleon\n", "Habitat: Rainforests\n", "Eats: Insects\n", "4 Legs\n", "Chameleons are known for their camouflage ability and are\nfound in rainforests. They feed on exotic bugs.\n", "", "");
Jungle.add(Jaguar);
Jungle.add(Capybara);
Jungle.add(Parrot);
Jungle.add(Toucan);
Jungle.add(Python);
Jungle.add(Chameleon);
for (int i = 0; i<Jungle.size(); i++) {
System.out.println(Jungle.get(i));
}
}
public static void forestry() {
ArrayList<Animal> Forestry = new ArrayList<Animal>();
Mammal Deer = new Mammal("Name: Deer\n", "Habitat: Forestry, ", "Eats: Plants\n", "4 Legs\n", "Deer are worldwide animals that live in forest environments.\nThey are herbivores and thus feed on vegetation.\n", "", "");
Mammal Raccoon = new Mammal("Name: Raccoon\n", "Habitat: Forestry\n", "Eats: Plants/Insects/Rodents\n", "4 Legs\n", "Raccoons live in forestry in several climates.\nThey feed on plants, insects and small rodents such as mice and shrews.\n", "", "");
Bird Owl= new Bird("Name: Owl\n", "Habitat: Forestry\n", "Eats: Insects\n", "2 Legs\n", "Wingspan: 35in\n", "Owls are worldwide birds that have many sub-classifications.\nThey eat insects and are predators for this reason.\n", "");
Bird Woodpecker = new Bird("Name: Woodpecker\n", "Habitat: Forestry\n", "Eats: Grubs/Insects\n", "2 Legs\n", "Wingspan: 28in\n", "Woodpeckers are worldwide birds that are known for their insect hunting method\nof pecking trees to attract insects\n", "");
Forestry.add(Deer);
Forestry.add(Raccoon);
Forestry.add(Owl);
Forestry.add(Woodpecker);
for (int i = 0; i<Forestry.size(); i++) {
System.out.println(Forestry.get(i));
}
}
public static void allenviro() {
ArrayList<Animal> AllHabs = new ArrayList<Animal>();
Reptile Lizard = new Reptile("Name: Common Lizard\n", "Habitat: All Habitats\n", "Eats: Insects\n", "4 Legs\n", "The common lizard can be found in many environments worldwide.\nThey feed on small insects from all environments.\n", "", "");
Fish crab = new Fish("Name: Crab\n", "Habitat: All Environments\n", "Eats: Carcasses/Plants\n", "10 Legs\n", "Length: Between 10cm - 2m\n", "Crabs are all-environment crustaceans that scavenge\nfor fish carcasses and plants in their environment\n", "");
Fish Eel = new Fish("Name: Eel\n", "Habitat: All Environments, Bottom Dwellers\n", "Eats: Small fish\n", "Length: 70cm\n", "Eels are bottom dweller fish found in all environments.\nThey feed on small fish and plants\n", "", "");
Fish Bullshark = new Fish("Name: Bull Shark\n", "Habitat: Warm, shallow water\n", "Eats: All sealife\n", "Length: 11 feet\n", "Bull Shark are predators typically found in warm, shallow water\nand feed on all types of sealife from small to larger fish and other sharks.\n", "", "");
Fish Salmon = new Fish("Name: Salmon\n", "Habitat: Clear rivers\n", "Eats: Invertebrates/Small fish\n", "Length: Up to 30in\n", "Salmon are common fish found in clearwater rivers.\nThey feed on invertebrates and small fish also found in their habitat\n", "", "");
Fish carp = new Fish("Name: Carp\n", "Habitat: Lakes, Rivers\n", "Eats: Dead fish/Crustaceans\n", "Length: 60cm\n", "Carp are common fish that are found in lakes andrivers.\nThey feed mainly on dead fish and crustaceans.\n", "", "");
AllHabs.add(Lizard);
AllHabs.add(crab);
AllHabs.add(Eel);
AllHabs.add(Bullshark);
AllHabs.add(Salmon);
AllHabs.add(carp);
for (int i = 0; i<AllHabs.size(); i++) {
System.out.println(AllHabs.get(i));
}
}
public static void carnivore() {
ArrayList<Animal> Carnivores = new ArrayList<Animal>();
Fish Snailfish = new Fish("Name: Snailfish\n", "Habitat: Cold Water\n", "Eats: Crustaceans\n", "Length: 30cm\n", "Snailfish are cold water fish that are often found in\ncolder climates. they feed on crustaceans.\n", "", "");
Fish Eel = new Fish("Name: Eel\n", "Habitat: All Environments, Bottom Dwellers\n", "Eats: Small fish\n", "Length: 70cm\n", "Eels are bottom dweller fish found in all environments.\nThey feed on small fish and plants\n", "", "");
Fish Bullshark = new Fish("Name: Bull Shark\n", "Habitat: Warm, shallow water\n", "Eats: All sealife\n", "Length: 11 feet\n", "Bull Shark are predators typically found in warm, shallow water\nand feed on all types of sealife from small to larger fish and other sharks.\n", "", "");
Fish Salmon = new Fish("Name: Salmon\n", "Habitat: Clear rivers\n", "Eats: Invertebrates/Small fish\n", "Length: Up to 30in\n", "Salmon are common fish found in clearwater rivers.\nThey feed on invertebrates and small fish also found in their habitat\n", "", "");
Reptile Crocodile = new Reptile("Name: Crocodile\n", "Habitat: Jungle/Swamps\n", "Eats: Small Animals\n", "4 Legs\n", "Crocodiles, related to alligators are jungle/swamp\ndwellers that feed on small to medium mammals.\n", "", "");
Reptile Python = new Reptile("Name: Python\n", "Habitat: Jungle/Swamps\n", "Eats: Small/Medium Mammals\n", "0 Legs\n", "Pythoins are a type of snake found in the jungle/swamp environments.\nThey feed on small to medium mammals local to their habitat.\n", "", "");
Bird Penguin = new Bird("Name: Penguin\n", "Habitat: Antarctic\n","Eats: Sealife\n","2 Legs\n", "Wingspan: 30in\n", "Penguins are large Antarctic birds that come in many forms.\nThey feed on fish in their envornment.\n", "");
Bird SnowOwl = new Bird("Name: Snow Owl\n", "Habitat: Arctic\n", "Eats: Lemmings/Small Animals\n", "2 Legs\n", "Wingspan: 165cm\n", "Snow Owls are small owls that live in the arctic\nThey feed on lemmings and small rodents.\n", "");
Bird Falcon = new Bird("Name: Falcon\n", "Habitat: Desert\n", "Eats: Small Birds/Fish\n", "2 Legs\n", "Wingspan: 120cm\n", "Falcons are large birds of prey that come in many forms.\nThey feed on small birds and fish and can be found\nin many environments.\n", "");
Mammal PBear = new Mammal("Name: Polar Bear\n","Habitat: Arctic\n","Eats: Seals\n","4 Legs\n", "Polar Bears are large white bears that live in the Arctic.\nThey are carnivores and often search in the water for seals to hunt.\n", " ", "");
Mammal Seal = new Mammal("Name: Seal\n", "Habitat: Arctic\n", "Eats: Fish\n", "2 Legs\n", "Seals are large aquatic mammals that live in the arctic and antarctic\nThey live in the sea primarily and often hunt schools of fish.\n", "", "");
Mammal Coyote = new Mammal("Name: Coyote\n", "Habitat: Desert\n", "Eats: Animals/Fruit\n", "4 Legs\n", "Coyotes are desert and plain animals that are typically feral.\nThey feed on other animals and fruit.\n", "", "");
Mammal Jaguar = new Mammal("Name: Jaguar\n", "Habitat: Jungle/Rainforest\n", "Eats: Deer/Capybara\n", "4 Legs\n", "Jaguars are big cat predators that live in\njungle and rainforest environments.\n They feed on deer and capybara local to the environent.\n", "", "");
Mammal Raccoon = new Mammal("Name: Raccoon\n", "Habitat: Forestry\n", "Eats: Plants/Insects/Rodents\n", "4 Legs\n", "Raccoons live in forestry in several climates.\nThey feed on plants, insects and small rodents such as mice and shrews.\n", "", "");
Carnivores.add(Snailfish);
Carnivores.add(Eel);
Carnivores.add(Bullshark);
Carnivores.add(Salmon);
Carnivores.add(Crocodile);
Carnivores.add(Python);
Carnivores.add(Penguin);
Carnivores.add(SnowOwl);
Carnivores.add(Falcon);
Carnivores.add(PBear);
Carnivores.add(Coyote);
Carnivores.add(Seal);
Carnivores.add(Jaguar);
Carnivores.add(Raccoon);
for (int i = 0; i<Carnivores.size(); i++) {
System.out.println(Carnivores.get(i));
}
}
public static void herbivore() {
ArrayList<Animal> Herbivores = new ArrayList<Animal>();
Reptile Tortoise = new Reptile("Name: Tortoise\n", "Habitat: Deserts\n", "Eats: Plants/Vegetation\n", "4 Legs\n", "Tortoises are large, shelled reptiles that live a long time.\nThey feed on desert plants and vegatation.\n", "", "");
Reptile BDragon = new Reptile("Name: Bearded Dragon\n", "Habitat: Deserts\n", "Eats: Plants/Insects\n", "4 Legs\n", "Bearded Dragons are medium sized, lizard type reptiles.\nThey feed on plants and insects in the desert environment.\n", "", "");
Mammal Camel = new Mammal("Name: Camel\n", "Habitat: Desert\n", "Eats: Plants\n", "4 Legs\n", "Camels are desert mammals that exist in worldwide deserts.\nThey eat dry vegetation and plants in the environment.\n", "", "");
Mammal Deer = new Mammal("Name: Deer\n", "Habitat: Forestry, ", "Eats: Plants\n", "4 Legs\n", "Deer are worldwide animals that live in forest environments.\nThey are herbivores and thus feed on vegetation.\n", "", "");
Herbivores.add(Tortoise);
Herbivores.add(BDragon);
Herbivores.add(Camel);
Herbivores.add(Deer);
for (int i = 0; i<Herbivores.size(); i++) {
System.out.println(Herbivores.get(i));
}
}
public static void otherdiet() {
ArrayList<Animal> Otherdiets = new ArrayList<Animal>();
Reptile Lizard = new Reptile("Name: Common Lizard\n", "Habitat: All Habitats\n", "Eats: Insects\n", "4 Legs\n", "The common lizard can be found in many environments worldwide.\nThey feed on small insects from all environments.\n", "", "");
Reptile Chameleon = new Reptile("Name: Chameleon\n", "Habitat: Rainforests\n", "Eats: Insects\n", "4 Legs\n", "Chameleons are known for their camouflage ability and are\nfound in rainforests. They feed on exotic bugs.\n", "", "");
Fish carp = new Fish("Name: Carp\n", "Habitat: Lakes, Rivers\n", "Eats: Dead fish/Crustaceans\n", "Length: 60cm\n", "Carp are common fish that are found in lakes andrivers.\nThey feed mainly on dead fish and crustaceans.\n", "", "");
Fish crab = new Fish("Name: Crab\n", "Habitat: All Environments\n", "Eats: Carcasses/Plants\n", "10 Legs\n", "Length: Between 10cm - 2m\n", "Crabs are all-environment crustaceans that scavenge\nfor fish carcasses and plants in their environment\n", "");
Bird Vulture = new Bird("Name: Vulture\n", "Habitat: Desert\n", "Eats: Carcasses\n", "2 Legs\n", "Wingspan: 2.2m\n", "Vultures are large desert scavengers that feed\non dead animals due to their inability to hunt.\n", "");
Bird Parrot = new Bird("Name: Parrot\n", "Habitat: Jungle/Rainforest\n", "Eats: Plants/Insects\n", "2 Legs\n", "Wingspan: 4ft\n", "Parrots are exotic birds that are\ntypically found in rainforest environments.\nThey feed on plants and insects.\n", "");
Bird Toucan = new Bird("Name: Toucan\n", "Habitat: Jungle/Rainforest\n", "Eats: Plants/Insects/Rodents\n", "2 Legs\n", "Wingspan: 52in\n", "Toucans are exotic birds that live in the rainforest.\nThey are similar to parrots in diet and environment.\n", "");
Bird Owl= new Bird("Name: Owl\n", "Habitat: Forestry\n", "Eats: Insects\n", "2 Legs\n", "Wingspan: 35in\n", "Owls are worldwide birds that have many sub-classifications.\nThey eat insects and are predators for this reason.\n", "");
Bird Woodpecker = new Bird("Name: Woodpecker\n", "Habitat: Forestry\n", "Eats: Grubs/Insects\n", "2 Legs\n", "Wingspan: 28in\n", "Woodpeckers are worldwide birds that are known for their insect hunting method\nof pecking trees to attract insects\n", "");
Mammal Raccoon = new Mammal("Name: Raccoon\n", "Habitat: Forestry\n", "Eats: Plants/Insects/Rodents\n", "4 Legs\n", "Raccoons live in forestry in several climates.\nThey feed on plants, insects and small rodents such as mice and shrews.\n", "", "");
Otherdiets.add(Lizard);
Otherdiets.add(Chameleon);
Otherdiets.add(carp);
Otherdiets.add(crab);
Otherdiets.add(Vulture);
Otherdiets.add(Parrot);
Otherdiets.add(Toucan);
Otherdiets.add(Owl);
Otherdiets.add(Woodpecker);
Otherdiets.add(Raccoon);
for (int i = 0; i<Otherdiets.size(); i++) {
System.out.println(Otherdiets.get(i));
}
}
public static void main (String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Welcome to YSJ Zoo! Please select an option to get started.\n\n");
System.out.println("1\t Show all of our animals");
System.out.println("2\t Choose a random animal and show their details");
System.out.println("3\t Show our Mammals");
System.out.println("4\t Show our Birds");
System.out.println("5\t Show our Fish");
System.out.println("6\t Show our Reptiles");
System.out.println("7\t Show our desert animals");
System.out.println("8\t Show our arctic/antarctic animals");
System.out.println("9\t Show our jungle/rainforest animals");
System.out.println("10\t Show our forestry/woodland animals");
System.out.println("11\t Show our animals from all environments");
System.out.println("12\t Show our carnivores");
System.out.println("13\t Show our herbivores");
System.out.println("14\t Show our animals with other diets\n");
System.out.println("Please enter your choice:");
int choice=in.nextInt();
switch (choice) {
case 1:
animals();
break;
case 2:
animalsrand();
break;
case 3:
Mammals();
break;
case 4:
birds();
break;
case 5:
fish();
break;
case 6:
reptiles();
break;
case 7:
desert();
break;
case 8:
arctic();
break;
case 9:
jungle();
break;
case 10:
forestry();
break;
case 11:
allenviro();
break;
case 12:
carnivore();
break;
case 13:
herbivore();
break;
case 14:
otherdiet();
break;
default:
System.out.print("Invalid selection, please reload and try again");
}
in.close();
}
}
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