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

Initial Commit

parent b0105213
...@@ -3,7 +3,7 @@ import java.util.Scanner; ...@@ -3,7 +3,7 @@ import java.util.Scanner;
class Main { class Main {
public static void main(String[] args) { public static void main(String[] args) {
//string variable //string variables storing all animals in a single array list
String showbreed; String showbreed;
String showform; String showform;
String animalrock; String animalrock;
...@@ -14,7 +14,7 @@ public static void main(String[] args) { ...@@ -14,7 +14,7 @@ public static void main(String[] args) {
String animalsteve; String animalsteve;
String animalchloe; String animalchloe;
String animalkevin; String animalkevin;
//mammal class
class mammal class mammal
{ {
...@@ -23,7 +23,7 @@ public static void main(String[] args) { ...@@ -23,7 +23,7 @@ public static void main(String[] args) {
String age; String age;
String enviroment; String enviroment;
} }
//types of mammals
mammal armadillio = new mammal(); mammal armadillio = new mammal();
armadillio.name="rock"; armadillio.name="rock";
armadillio.id="1"; armadillio.id="1";
...@@ -35,7 +35,7 @@ deer.name="rut"; ...@@ -35,7 +35,7 @@ deer.name="rut";
deer.id="2"; deer.id="2";
deer.age="9"; deer.age="9";
deer.enviroment="Forest"; deer.enviroment="Forest";
//bird class
class bird class bird
{ {
...@@ -44,7 +44,7 @@ class bird ...@@ -44,7 +44,7 @@ class bird
String age; String age;
String enviroment; String enviroment;
} }
//types of birds
bird toucan = new bird(); bird toucan = new bird();
toucan.name="fred"; toucan.name="fred";
toucan.id="3"; toucan.id="3";
...@@ -56,7 +56,7 @@ snowyowl.name="kate"; ...@@ -56,7 +56,7 @@ snowyowl.name="kate";
snowyowl.id="4"; snowyowl.id="4";
snowyowl.age="6"; snowyowl.age="6";
snowyowl.enviroment="Arctic"; snowyowl.enviroment="Arctic";
//fish class
class fish class fish
{ {
...@@ -65,7 +65,7 @@ class fish ...@@ -65,7 +65,7 @@ class fish
String age; String age;
String enviroment; String enviroment;
} }
//types of fish
fish clownfish = new fish(); fish clownfish = new fish();
clownfish.name="jack"; clownfish.name="jack";
clownfish.id="5"; clownfish.id="5";
...@@ -77,7 +77,7 @@ stingray.name="steve"; ...@@ -77,7 +77,7 @@ stingray.name="steve";
stingray.id="6"; stingray.id="6";
stingray.age="40"; stingray.age="40";
stingray.enviroment="Reef"; stingray.enviroment="Reef";
//reptile class
class reptile class reptile
{ {
...@@ -86,7 +86,7 @@ class reptile ...@@ -86,7 +86,7 @@ class reptile
String age; String age;
String enviroment; String enviroment;
} }
//types of reptiles
reptile cameleon = new reptile(); reptile cameleon = new reptile();
cameleon.name="chloe"; cameleon.name="chloe";
cameleon.id="7"; cameleon.id="7";
...@@ -99,10 +99,10 @@ crocodile.id="8"; ...@@ -99,10 +99,10 @@ crocodile.id="8";
crocodile.age="77"; crocodile.age="77";
crocodile.enviroment="Jungle"; 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); 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("Welcome to the YSJ Zoo!");
System.out.println(""); System.out.println("");
System.out.println("Which animal in your favourite?"); System.out.println("Which animal in your favourite?");
...@@ -116,7 +116,7 @@ crocodile.enviroment="Jungle"; ...@@ -116,7 +116,7 @@ crocodile.enviroment="Jungle";
System.out.println("Reptile Class"); System.out.println("Reptile Class");
System.out.println(""); System.out.println("");
showform = console.next(); showform = console.next();
//These asks the user questions to choose between each type
switch (showform) switch (showform)
{ {
...@@ -175,10 +175,10 @@ crocodile.enviroment="Jungle"; ...@@ -175,10 +175,10 @@ crocodile.enviroment="Jungle";
} }
break; 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); Scanner uni = new Scanner(System.in);
showbreed = uni.next(); 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) switch (showbreed)
{ {
case "Armadillio": case "Armadillio":
...@@ -346,3 +346,4 @@ console.close(); ...@@ -346,3 +346,4 @@ console.close();
uni.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