Commit 85742d3e authored by affankhan's avatar affankhan

Commit #1

parents
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Virtual Zoo Affan Khan</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
public class Animals {
//establish the member variables
String name;
String scientificName;
String diet;
String habitat;
String physicalCharacteristics;
//create the constructor
Animals (String name, String scientificName, String diet, String habitat, String physicalCharacteristics) {
this.name = name;
this.scientificName = scientificName;
this.diet = diet;
this.habitat = habitat;
this.physicalCharacteristics = physicalCharacteristics;
}//end of the constructor
//create the print name method
void printName () {
System.out.println("Animal Name: " + name);
}//end of the print name method
//create the print details method
void printDetails () {
System.out.println("Animal Name: " + name);
System.out.println("Scientific Name: " + scientificName);
System.out.println("Diet: " + diet);
System.out.println("Habitat: " + habitat);
System.out.println("Physical Characteristics: " + physicalCharacteristics);
}//end of the print details method
//create the print habitat method
void printHabitat () {
System.out.println(name + "'s Habitat: " + habitat);
}//end of print habitat method
//create a method that prints the diet of the animal
void printDiet() {
//create the if statement for when the animal is a carnivore
if(diet == "Carnivores") {
System.out.println(name + "'s Diet: Meat");
}//end of the carnivore if statement
//create the if statement for when the animal is a herbivore
if(diet == "Herbivores") {
System.out.println(name + "'s Diet: Plants");
}//end of the herbivore if statement
//create the if statement for when the animal is a omnivore
if(diet == "Omnivores") {
System.out.println(name + "'s Diet: Meat and Plants");
}//end of the omnivore if statement
}
}
public class Birds extends Animals {
String birdFeature = "Have Feathers";
String birdFeature2 = "Lay Hard Shelled Eggs";
String birdFeature3 = "Toothless Beaked Jaws";
//create the constructor
Birds (String name, String scientificName, String diet, String habitat, String physicalCharacteristics) {
super(name, scientificName, diet, habitat, physicalCharacteristics);
}//end of the constructor
//create the print name method
void printName () {
super.printName();
}//end of print name method
//create the print details method
void printDetails () {
super.printDetails();
System.out.println("Features of Birds: " + birdFeature);
System.out.println(" " + birdFeature2);
System.out.println(" " + birdFeature3);
System.out.println("______________________________________________________________________________");
}//end of print details
//create the print habitat method
void printHabitat () {
super.printHabitat();
}//end of print habitat method
//create the print diet method
void printDiet () {
super.printDiet();
}//end of the print diet
}
public class Fish extends Animals {
//create the unique features variables
String fishFeature = "Use Gills to Breathe";
String fishFeature2 = "Use Fins for Movement";
String fishFeature3 = "Thrive in Water";
//create the constructor
Fish (String name, String scientificName, String diet, String habitat, String physicalCharacteristics) {
super(name, scientificName, diet, habitat, physicalCharacteristics);
}//end of the constructor
//create the print name method
void printName () {
super.printName();
}//end of print name method
//create the print details method
void printDetails () {
super.printDetails();
System.out.println("UniqueFeatures: " + fishFeature);
System.out.println(" " + fishFeature2);
System.out.println(" " + fishFeature3);
System.out.println("______________________________________________________________________________");
}//end of print details
//create the print habitat method
void printHabitat () {
super.printHabitat();
}//end of print habitat method
//create the print diet method
void printDiet () {
super.printDiet();
}//end of the print diet
}
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
//establish the scanner
static Scanner scan = new Scanner(System.in);
//establish the animals ArrayList
static ArrayList<Animals> animals = new ArrayList<Animals>();
public static void main(String[] args) {
// TODO Auto-generated method stub
//Habitats: Grasslands, Rainforests, Tundra, Mountains, Lakes, Sea
//create five mammal objects using the ArrayList
//mammals are located on the 0-4 index
animals.add(new Mammals("Lion", "Panthera leo", "Carnivores", "Grasslands", "Powerful Legs, Sharp Teeth, Yellow-Gold Fur"));
animals.add(new Mammals("Asian Elephant", "Elephas maximus", "Herbivores", "Rainforests", "Long Trunk, Grayish in Colour, Largest Land Animal"));
animals.add(new Mammals("Polar Bear", "Ursus maritimus", "Carnivores", "Tundra", "White Fur, Narrow Head with Small Ears, Five Claws"));
animals.add(new Mammals("Reindeer", "Rangifer tarandus", "Grasslands", "Herbivores", "Large Antlers, Hooves, Colour of the Fur Varies"));
animals.add(new Mammals("Gorilla", "Gorilla beringei", "Omnivores", "Rainforests", "Broad Chest, Hairless Face, Prominent Nostrils"));
//create five bird objects using the ArrayList
//birds are located on the 5-9 index
animals.add(new Birds("Scarlet Macaw", "Ara macao", "Herbivores", "Rainforests", "Red, Yellow and Blue in Color,"));
animals.add(new Birds("Shaheen Falcon", "Falco peregrinus", "Carnivores", "Grasslands", "Blue-Grey Wings, Brown Back, White Face"));
animals.add(new Birds("American Eagle", "Haliaeetus leucocephalus", "Carnivores", "Lakes", "White Head, Black Body and Wings, Yellow Legs"));
animals.add(new Birds("Emperor Penguin", "Aptenodytes forsteri", "Carnivores", "Tundra", "Black and White Body, Black Wings, Yellow"));
animals.add(new Birds("Bee Hummingbird", "Mellisuga helenae", "Herbivores", "Rainforests", "Blue Wings and Back, White Torso, Pinkish Head"));
//create five fish objects using the ArrayList
//Fish are located on the 10-14 index
animals.add(new Fish("Goldfish","Carassius auratus","Omnivores","Lakes","Gold Bakc, Oranage Head, White Torso"));
animals.add(new Fish("Blue Tang","Paracanthurus hepatus","Herbivores","Lakes","Blue Torso, Black Back, Green Tail and Fins"));
animals.add(new Fish("Whale Shark","Rhincodon typus","Carnivores","Sea","Dark Blue Body, White Dot Pattern, Toothless"));
animals.add(new Fish("Stone Fish","Synanceia verrucosa","Carnivores","Sea","Brown or Grey Scaleless Skin, Patches or Orange"));
animals.add(new Fish("Coho Salmon","Oncorhynchus kisutch","Carnivores","Tundra","Silver Body, Black Spots on Head, Fins, and Tail"));
//create five reptile objects using the ArrayList
//reptiles are located on the 15-19 index
animals.add(new Reptiles("American Crocodile","Crocodylus acutus","Carnivores","Lakes","Long Mouth, Razor Sharp Teeth, Greyish Color"));
animals.add(new Reptiles("Alligator Snapping Turtle","Macrochelys temminckii","Carnivores","Lakes","Hard Body, Muscular Limbs, Fat Mouth"));
animals.add(new Reptiles("Rhinoceros Iguana","Cyclura cornuta","Herbivores","Grasslands","Excess Skin, Small Horn on the Head, Long Tail"));
animals.add(new Reptiles("Black Mamba","Dendroaspis polylepis","Carnivores","Grasslands","Grey Back, White Torso, Black Mouth, Fangs"));
animals.add(new Reptiles("Northland Green Gecko","Naultinus grayii","Carnivores","Rainforests","Green Body, White Spots on Body, Yellow Eyes"));
//create an infinite loop so the user can reuse the application without restarting
while (true) {
//ask the audience as to what they would like to do
System.out.println("");
System.out.println("What would you like to do");
System.out.println("1. Display the names of all the animals in the zoo");
System.out.println("2. Display the details of the animals");
System.out.println("3. Display the food required by the animals");
System.out.println("4. Display the names of all the animals from an animal group");
System.out.println("5. Display the animals that are from the habitat");
System.out.println("__________________________________________________________________");
System.out.println("Please enter the corresponding number of your choice:");
//establish the audience choice as a variable
int audienceChoice = scan.nextInt();
//create an if statement for when the users select option 1
if (audienceChoice == 1) {
displayNamesOfAnimals();
}//end of if statement
//create an if statement for when the users select option 2
if (audienceChoice == 2) {
displayDetailsOfAnimals();
}//end of if statement
//create an if statement for when the users select option 3
if (audienceChoice == 3) {
displayFoodOfAnimals();
}//end of the if statement for when the users select option 3
//create the if statement for when the users select option 4
if (audienceChoice == 4) {
displayGroupAnimalsName();
}//end of the if statement for when the users select option 4
//create the if statement for when the users select option 5
if (audienceChoice == 5) {
displayAnimalsFromHabitat();
}//end of the if statement for when the audience select option 5
//create an if statement for when an invalid number is entered
if (audienceChoice > 5) {
System.out.println("Invalid Number Enetered");
}//end of the invalid choice if statement
}//end of the infinite loop
}//end of main method
//create the method that displays the names of all the animals in the ArrayList
static void displayNamesOfAnimals() {
//create the space between the user input and the animal names
System.out.println("");
//create a for loop that will print the names of all animals
for (int i = 0; i < animals.size(); i++) {
animals.get(i).printName();;
}//end of the for loop
}//end of the method that displays the names of all animals
static void displayDetailsOfAnimals() {
//ask the audience if they want details of all animals, a group of animals, or a specific animal
System.out.println("Would you like get the details of:");
System.out.println("1. All Animals");
System.out.println("2. A group of animals");
System.out.println("3. A specific animal");
System.out.println("__________________________________________________________________");
System.out.println("Please enter the corresponding number of your choice:");
//establish the variable of the audience's choice
int audienceChoice = scan.nextInt();
//create a space between the user input and the animal details
System.out.println("");
//create the if statement for when the user wants to print the details of all animals
if (audienceChoice == 1) {
//create a for loop that will print out the details of every animal
for (int i = 0; i < animals.size(); i++) {
animals.get(i).printDetails();
}//end of the for loop
}//end of the if statement to print out all the details of the animal
//create the if statement when the audience want the details of a group of animals
if (audienceChoice == 2) {
displayGroupAnimalsDetails();
}//end of the if statement for a group of animals
//create the if statement when the audience want the details of a group of animals
if (audienceChoice == 3) {
displaySingleAnimalDetails();
}//end of the if statement for a group of animals
//create an if statement for when an invalid number is entered
if (audienceChoice > 3) {
System.out.println("Invalid Number Enetered");
}//end of the invalid choice if statement
}//end of the method that displays the details of the animals
//create a method that displays details of a group of animals
static void displayGroupAnimalsDetails() {
//print out the options of the animals groups
System.out.println("The choices of the animal groups are:");
System.out.println("1. Mammals");
System.out.println("2. Birds");
System.out.println("3. Fish");
System.out.println("4. Reptiles");
System.out.println("__________________________________________________________________");
System.out.println("Please enter the corresponding number of your choice:");
//create a int variable which will represent the input
int animalGroupChoice = scan.nextInt();
//create a space between the user inputs and the list of animals
System.out.println("");
//create the if statement when the users want the details of mammals
if (animalGroupChoice == 1) {
//create a for loop which only prints the details of the mammals
for (int i = 0; i < 5; i++) {
animals.get(i).printDetails();
}//end of the mammals for loop
}//end of the if statement for mammals
//create the if statement when the users want the details of Birds
if (animalGroupChoice == 2) {
//create a for loop which only prints the details of the Birds
for (int i = 5; i < 9; i++) {
animals.get(i).printDetails();
}//end of the Birds for loop
}//end of the if statement for Birds
//create the if statement when the users want the details of Fish
if (animalGroupChoice == 3) {
//create a for loop which only prints the details of the Fish
for (int i = 10; i < 14; i++) {
animals.get(i).printDetails();
}//end of the Fish for loop
}//end of the if statement for Fish
//create the if statement when the users want the details of Reptiles
if (animalGroupChoice == 4) {
//create a for loop which only prints the details of the Reptiles
for (int i = 5; i < 9; i++) {
animals.get(i).printDetails();
}//end of the Reptiles for loop
}//end of the if statement for Reptiles
//create an if statement for when an invalid number is entered
if (animalGroupChoice > 4) {
System.out.println("Invalid Number Enetered");
}//end of the invalid choice if statement
}//end of the method that displays details of a group of animals
//create a method that print the details of a specific animal
static void displaySingleAnimalDetails() {
//inform the audience the list of animals
System.out.println("The list of animals are the following:");
//create an int variable for the corresponding number
int correspondingNumber = 1;
//create a for loop that will run through the ArrayList
for (int i = 0; i < animals.size(); i++) {
System.out.println(correspondingNumber + " " + animals.get(i).name);
correspondingNumber = correspondingNumber + 1;
}//end of the for loop
//ask them which animal details they want
System.out.println("__________________________________________________________________");
System.out.println("Please enter the corresponding number of your choice:");
//get the audience input
int audienceChoice = scan.nextInt();
//create an integer variable which will represent the index
int index = audienceChoice - 1;
//create a space between the audience input and the details
System.out.println("");
//create an if statement for a valid number
if (audienceChoice <= 20) {
//print the the the of the desired index
animals.get(index).printDetails();
}//end of the valid if statement
//create an if statement for when an invalid number is entered
else {
System.out.println("Invalid Number Enetered");
}//end of the invalid choice if statement
}//end of method that will display details of a single animal
static void displayFoodOfAnimals() {
//ask the audience if they want diet of all animals, a group of animals, or a specific animal
System.out.println("Which animal's diet would like you know:");
System.out.println("1. All Animals");
System.out.println("2. A group of animals");
System.out.println("3. A specific animal");
System.out.println("__________________________________________________________________");
System.out.println("Please enter the corresponding number of your choice:");
//create a int variable which will represent the input
int audienceChoice = scan.nextInt();
//create a space between the user inputs and the list of animals
System.out.println("");
//create the if statement that displays the diet of all the animals
if (audienceChoice == 1) {
//create a for loop that will iterate through the ArrayList
for (int i = 0; i < animals.size(); i++) {
animals.get(i).printDiet();
}//end of the for loop
}//end of the if statement for all the animal diet
//create the if statement for the diet of a group of animals
if (audienceChoice == 2) {
displayGroupAnimalsDiet();
}//end of the if statement for the group of animals
//create the if statement for the diet of a single animal
if(audienceChoice == 3) {
displaySingleAnimalDiet();
}//end of the if statement for the single animal diet
//create an if statement for when an invalid number is entered
if (audienceChoice > 3) {
System.out.println("Invalid Number Enetered");
}//end of the invalid choice if statement
}//end of the food required method
//create a method that will display the diet of animal groups
static void displayGroupAnimalsDiet() {
//print out the options of the animals groups
System.out.println("The choices of the animal groups are:");
System.out.println("1. Mammals");
System.out.println("2. Birds");
System.out.println("3. Fish");
System.out.println("4. Reptiles");
System.out.println("__________________________________________________________________");
System.out.println("Please enter the corresponding number of your choice:");
//create a int variable which will represent the input
int animalGroupChoice = scan.nextInt();
//create a space between the user inputs and the list of animals
System.out.println("");
//create the if statement when the users want the diet of mammals
if (animalGroupChoice == 1) {
//create a for loop which only prints the diet of the mammals
for (int i = 0; i < 5; i++) {
animals.get(i).printDiet();
}//end of the mammals for loop
}//end of the if statement for mammals
//create the if statement when the users want the diet of Birds
if (animalGroupChoice == 2) {
//create a for loop which only prints the diet of the Birds
for (int i = 5; i < 9; i++) {
animals.get(i).printDiet();
}//end of the Birds for loop
}//end of the if statement for Birds
//create the if statement when the users want the diet of Fish
if (animalGroupChoice == 3) {
//create a for loop which only prints the diet of the Fish
for (int i = 10; i < 14; i++) {
animals.get(i).printDiet();
}//end of the Fish for loop
}//end of the if statement for Fish
//create the if statement when the users want the diet of Reptiles
if (animalGroupChoice == 4) {
//create a for loop which only prints the diet of the Reptiles
for (int i = 5; i < 9; i++) {
animals.get(i).printDiet();
}//end of the Reptiles for loop
}//end of the if statement for Reptiles
//create an if statement for when an invalid number is entered
if (animalGroupChoice > 4) {
System.out.println("Invalid Number Enetered");
}//end of the invalid choice if statement
}//end of the method that displays the diet of a group of animals
//create a method that displays the diet of a single animal
static void displaySingleAnimalDiet() {
//inform the audience the list of animals
System.out.println("The list of animals are the following:");
//create an int variable for the corresponding number
int correspondingNumber = 1;
//create a for loop that will run through the ArrayList
for (int i = 0; i < animals.size(); i++) {
System.out.println(correspondingNumber + " " + animals.get(i).name);
correspondingNumber = correspondingNumber + 1;
}//end of the for loop
//ask them which animal details they want
System.out.println("__________________________________________________________________");
System.out.println("Please enter the corresponding number of your choice:");
//get the audience input
int audienceChoice = scan.nextInt();
//create an integer variable which will represent the index
int index = audienceChoice - 1;
//create a space between the audience input and the details
System.out.println("");
//create an if statement to ensure a valid number is entered
if (audienceChoice <= 20) {
//print the the the of the desired index
animals.get(index).printDiet();
}//end of the valid number if statement
//create an else statement for when an invalid number is entered
else {
System.out.println("Invalid Number Enetered");
}//end of the invalid choice else statement
}//end of the method that displays the diet of a single animal
//create a method that will display the names of a group of animals
static void displayGroupAnimalsName() {
//print out the options of the animals groups
System.out.println("The choices of the animal groups are:");
System.out.println("1. Mammals");
System.out.println("2. Birds");
System.out.println("3. Fish");
System.out.println("4. Reptiles");
System.out.println("__________________________________________________________________");
System.out.println("Please enter the corresponding number of your choice:");
//create a int variable which will represent the input
int animalGroupChoice = scan.nextInt();
//create a space between the user inputs and the list of animals
System.out.println("");
//create the if statement when the users want the names of mammals
if (animalGroupChoice == 1) {
//create a for loop which only prints the names of the mammals
for (int i = 0; i < 5; i++) {
animals.get(i).printName();
}//end of the mammals for loop
}//end of the if statement for mammals
//create the if statement when the users want the names of Birds
if (animalGroupChoice == 2) {
//create a for loop which only prints the names of the Birds
for (int i = 5; i < 9; i++) {
animals.get(i).printName();
}//end of the Birds for loop
}//end of the if statement for Birds
//create the if statement when the users want the names of Fish
if (animalGroupChoice == 3) {
//create a for loop which only prints the names of the Fish
for (int i = 10; i < 14; i++) {
animals.get(i).printName();
}//end of the Fish for loop
}//end of the if statement for Fish
//create the if statement when the users want the names of Reptiles
if (animalGroupChoice == 4) {
//create a for loop which only prints the names of the Reptiles
for (int i = 5; i < 9; i++) {
animals.get(i).printName();
}//end of the Reptiles for loop
}//end of the if statement for Reptiles
//create an if statement for when an invalid number is entered
if (animalGroupChoice > 4) {
System.out.println("Invalid Number Enetered");
}//end of the invalid choice if statement
}//end of the method that displays the list of a group of animals
//create a method that displays the names of the animals from a specific habitat
static void displayAnimalsFromHabitat() {
//inform the audience of the types of habitats present
System.out.println("The choices of the animal habitats are:");
System.out.println("1. Grasslands");
System.out.println("2. Rainforests");
System.out.println("3. Tundra");
System.out.println("4. Lakes");
System.out.println("5. Sea");
System.out.println("__________________________________________________________________");
System.out.println("Please enter the corresponding number of your choice:");
//create a int variable which will represent the input
int habitatChoice = scan.nextInt();
//create a space between the user inputs and the list of animals
System.out.println("");
//create a String ArrayList which will be used to display the names of the animals from a habitat
ArrayList<String> habitatAnimals = new ArrayList<String>();
//create a if statement for when the animals want the names of grassland animals
if (habitatChoice == 1) {
System.out.println("The animals of the Grassland habitat are:");
//create a for loop that will iterate through the animal ArrayList
for (int i = 0; i < animals.size(); i++) {
//create an if statement for when the animal habitat is grasslands
if (animals.get(i).habitat == "Grasslands") {
//add the animal name of the habitatAnimals string
habitatAnimals.add(animals.get(i).name);
}//end of the if statement for when the animal habitat is grasslands
}//end of the for loop that will iterate through the ArrayList
//print out the list of the animals from the grassland habitat
for (int j = 0; j < habitatAnimals.size(); j++) {
System.out.println(habitatAnimals.get(j));
}//end of the printing for loop
}//end of the if statement for the grassland animals
//create a if statement for when the animals want the names of rainforest animals
if (habitatChoice == 2) {
System.out.println("The animals of the Rainforest habitat are:");
//create a for loop that will iterate through the animal ArrayList
for (int i = 0; i < animals.size(); i++) {
//create an if statement for when the animal habitat is rainforest
if (animals.get(i).habitat == "Rainforests") {
//add the animal name of the habitatAnimals string
habitatAnimals.add(animals.get(i).name);
}//end of the if statement for when the animal habitat is rainforest
}//end of the for loop that will iterate through the ArrayList
//print out the list of the animals from the rainforest habitat
for (int j = 0; j < habitatAnimals.size(); j++) {
System.out.println(habitatAnimals.get(j));
}//end of the printing for loop
}//end of the if statement for the rainforest animals
//create a if statement for when the animals want the names of tundra animals
if (habitatChoice == 3) {
System.out.println("The animals of the Tundra habitat are:");
//create a for loop that will iterate through the animal ArrayList
for (int i = 0; i < animals.size(); i++) {
//create an if statement for when the animal habitat is tundra
if (animals.get(i).habitat == "Tundra") {
//add the animal name of the habitatAnimals string
habitatAnimals.add(animals.get(i).name);
}//end of the if statement for when the animal habitat is tundra
}//end of the for loop that will iterate through the ArrayList
//print out the list of the animals from the tundra habitat
for (int j = 0; j < habitatAnimals.size(); j++) {
System.out.println(habitatAnimals.get(j));
}//end of the printing for loop
}//end of the if statement for the tundra animals
//create a if statement for when the animals want the names of lake animals
if (habitatChoice == 4) {
System.out.println("The animals of the Lake habitat are:");
//create a for loop that will iterate through the animal ArrayList
for (int i = 0; i < animals.size(); i++) {
//create an if statement for when the animal habitat is lake
if (animals.get(i).habitat == "Lakes") {
//add the animal name of the habitatAnimals string
habitatAnimals.add(animals.get(i).name);
}//end of the if statement for when the animal habitat is lake
}//end of the for loop that will iterate through the ArrayList
//print out the list of the animals from the lake habitat
for (int j = 0; j < habitatAnimals.size(); j++) {
System.out.println(habitatAnimals.get(j));
}//end of the printing for loop
}//end of the if statement for the lake animals
//create a if statement for when the animals want the names of sea animals
if (habitatChoice == 5) {
System.out.println("The animals of the Sea habitat are:");
//create a for loop that will iterate through the animal ArrayList
for (int i = 0; i < animals.size(); i++) {
//create an if statement for when the animal habitat is rainforest
if (animals.get(i).habitat == "Sea") {
//add the animal name of the habitatAnimals string
habitatAnimals.add(animals.get(i).name);
}//end of the if statement for when the animal habitat is sea
}//end of the for loop that will iterate through the ArrayList
//print out the list of the animals from the sea habitat
for (int j = 0; j < habitatAnimals.size(); j++) {
System.out.println(habitatAnimals.get(j));
}//end of the printing for loop
}//end of the if statement for the sea animals
//create an if statement for when the user don't enter a valid number
if (habitatChoice > 5) {
System.out.println("Invalid Number Entered");
}//end of the invalid if statement
}//end of the method that displays the names of all the animals from a specific habitat
}//end of the main class
public class Mammals extends Animals {
String mammalFeature = "Contain Mammary Glands";
String mammalFeature2 = "Female Produce Milk";
String mammalFeature3 = "Contain Fur or Hair";
//create the constructor
Mammals (String name, String scientificName, String diet, String habitat, String physicalCharacteristics) {
super(name, scientificName, diet, habitat, physicalCharacteristics);
}//end of the constructor
//create the print name method
void printName () {
super.printName();
}//end of print name method
//create the print details method
void printDetails () {
super.printDetails();
System.out.println("Features of Mammals: " + mammalFeature);
System.out.println(" " + mammalFeature2);
System.out.println(" " + mammalFeature3);
System.out.println("______________________________________________________________________________");
}//end of print details
//create the print habitat method
void printHabitat () {
super.printHabitat();
}//end of print habitat method
//create the print diet method
void printDiet () {
super.printDiet();
}//end of the print diet
}
public class Reptiles extends Animals {
//create the unique features variables
String reptileFeature = "Bodies are Covered in Scales";
String reptileFeature2 = "Ferilize Eggs Internally";
String reptileFeature3 = "Consist of Atleast One Lung";
//create the constructor
Reptiles (String name, String scientificName, String diet, String habitat, String physicalCharacteristics) {
super(name, scientificName, diet, habitat, physicalCharacteristics);
}//end of the constructor
//create the print name method
void printName () {
super.printName();
}//end of print name method
//create the print details method
void printDetails () {
super.printDetails();
System.out.println("UniqueFeatures: " + reptileFeature);
System.out.println(" " + reptileFeature2);
System.out.println(" " + reptileFeature3);
System.out.println("______________________________________________________________________________");
}//end of print details
//create the print habitat method
void printHabitat () {
super.printHabitat();
}//end of print habitat method
//create the print diet method
void printDiet () {
super.printDiet();
}//end of the print diet
}
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