Commit 90cbb6eb authored by zak.evans's avatar zak.evans

Initial Commit

parent b0105213
......@@ -3,7 +3,7 @@ import java.util.Scanner;
class Main {
public static void main(String[] args) {
//string variable
//string variables storing all animals in a single array list
String showbreed;
String showform;
String animalrock;
......@@ -14,7 +14,7 @@ public static void main(String[] args) {
String animalsteve;
String animalchloe;
String animalkevin;
//mammal class
class mammal
{
......@@ -23,7 +23,7 @@ public static void main(String[] args) {
String age;
String enviroment;
}
//types of mammals
mammal armadillio = new mammal();
armadillio.name="rock";
armadillio.id="1";
......@@ -35,7 +35,7 @@ deer.name="rut";
deer.id="2";
deer.age="9";
deer.enviroment="Forest";
//bird class
class bird
{
......@@ -44,7 +44,7 @@ class bird
String age;
String enviroment;
}
//types of birds
bird toucan = new bird();
toucan.name="fred";
toucan.id="3";
......@@ -56,7 +56,7 @@ snowyowl.name="kate";
snowyowl.id="4";
snowyowl.age="6";
snowyowl.enviroment="Arctic";
//fish class
class fish
{
......@@ -65,7 +65,7 @@ class fish
String age;
String enviroment;
}
//types of fish
fish clownfish = new fish();
clownfish.name="jack";
clownfish.id="5";
......@@ -77,7 +77,7 @@ stingray.name="steve";
stingray.id="6";
stingray.age="40";
stingray.enviroment="Reef";
//reptile class
class reptile
{
......@@ -86,7 +86,7 @@ class reptile
String age;
String enviroment;
}
//types of reptiles
reptile cameleon = new reptile();
cameleon.name="chloe";
cameleon.id="7";
......@@ -99,10 +99,10 @@ crocodile.id="8";
crocodile.age="77";
crocodile.enviroment="Jungle";
//This creates a scanner object from the users keyboard input
//The scanner is used for the users input
Scanner console = new Scanner(System.in);
//Main introduction to the program
//Showcase for the start of virtual zoo
System.out.println("Welcome to the YSJ Zoo!");
System.out.println("");
System.out.println("Which animal in your favourite?");
......@@ -116,7 +116,7 @@ crocodile.enviroment="Jungle";
System.out.println("Reptile Class");
System.out.println("");
showform = console.next();
//These asks the user questions to choose between each type
switch (showform)
{
......@@ -175,10 +175,10 @@ crocodile.enviroment="Jungle";
}
break;
}
//Scanner reads in the users input and directs them on where they need to go in the switch.
//This scanner now reads the input and follows command
Scanner uni = new Scanner(System.in);
showbreed = uni.next();
//This shows the specific classes of animals with facts and questions. This displays full details of a single animal and shows the specific environments.
switch (showbreed)
{
case "Armadillio":
......@@ -346,3 +346,4 @@ console.close();
uni.close();
}
}
//Code closing making the zoo stop
\ No newline at end of file
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