Commit b0105213 authored by zak.evans's avatar zak.evans

Initial Commit

parent 5fd52cde
## Getting Started
Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code.
## Folder Structure
The workspace contains two folders by default, where:
- `src`: the folder to maintain sources
- `lib`: the folder to maintain dependencies
Meanwhile, the compiled output files will be generated in the `bin` folder by default.
> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there.
## Dependency Management
The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies).
File added
File added
public class App { import java.util.Scanner;
public static void main(String[] args) throws Exception {
System.out.println("Hello, World!"); class Main {
public static void main(String[] args) {
//string variable
String showbreed;
String showform;
String animalrock;
String animalrut;
String animalfred;
String animalkate;
String animaljack;
String animalsteve;
String animalchloe;
String animalkevin;
class mammal
{
String name;
String id;
String age;
String enviroment;
} }
mammal armadillio = new mammal();
armadillio.name="rock";
armadillio.id="1";
armadillio.age="37";
armadillio.enviroment="Desert";
mammal deer = new mammal();
deer.name="rut";
deer.id="2";
deer.age="9";
deer.enviroment="Forest";
class bird
{
String name;
String id;
String age;
String enviroment;
}
bird toucan = new bird();
toucan.name="fred";
toucan.id="3";
toucan.age="14";
toucan.enviroment="Jungle";
bird snowyowl = new bird();
snowyowl.name="kate";
snowyowl.id="4";
snowyowl.age="6";
snowyowl.enviroment="Arctic";
class fish
{
String name;
String id;
String age;
String enviroment;
}
fish clownfish = new fish();
clownfish.name="jack";
clownfish.id="5";
clownfish.age="3";
clownfish.enviroment="Reef";
fish stingray = new fish();
stingray.name="steve";
stingray.id="6";
stingray.age="40";
stingray.enviroment="Reef";
class reptile
{
String name;
String id;
String age;
String enviroment;
}
reptile cameleon = new reptile();
cameleon.name="chloe";
cameleon.id="7";
cameleon.age="21";
cameleon.enviroment="Jungle";
reptile crocodile = new reptile();
crocodile.name="kevin";
crocodile.id="8";
crocodile.age="77";
crocodile.enviroment="Jungle";
//This creates a scanner object from the users keyboard input
Scanner console = new Scanner(System.in);
//Main introduction to the program
System.out.println("Welcome to the YSJ Zoo!");
System.out.println("");
System.out.println("Which animal in your favourite?");
System.out.println("");
System.out.println("Mammal Class");
System.out.println("");
System.out.println("Bird Class");
System.out.println("");
System.out.println("Fish Class");
System.out.println("");
System.out.println("Reptile Class");
System.out.println("");
showform = console.next();
switch (showform)
{
case "Mammal" :
if(showform.contains("Mammal"))
{
System.out.println("Which animal in your favourite?");
System.out.println("");
System.out.println("Armadillio");
System.out.println("");
System.out.println("Deer");
System.out.println("");
}
break;
case "Bird" :
if(showform.contains("Bird"))
{
System.out.println("Which animal in your favourite?");
System.out.println("");
System.out.println("Toucan");
System.out.println("");
System.out.println("SnowyOwl");
System.out.println("");
}
break;
case "Fish" :
if(showform.contains("Fish"))
{
System.out.println("");
System.out.println("Which animal in your favourite?");
System.out.println("");
System.out.println("Clownfish");
System.out.println("");
System.out.println("Stingray");
System.out.println("");
;
}
break;
case "Reptile" :
if(showform.contains("Reptile"))
{
System.out.println("");
System.out.println("Which animal in your favourite?");
System.out.println("");
System.out.println("Cameleon");
System.out.println("");
System.out.println("Crocodile");
System.out.println("");
}
break;
}
//Scanner reads in the users input and directs them on where they need to go in the switch.
Scanner uni = new Scanner(System.in);
showbreed = uni.next();
switch (showbreed)
{
case "Armadillio":
if(showbreed.contains("Armadillio"))
{
System.out.println("Here comes" + " " + armadillio.name + " " + "he is super heavy and he is" + " " + armadillio.age + " " + "years old. His habitat is the" + " " + armadillio.enviroment);
System.out.println("");
System.out.println("Do you want to feel him?");
System.out.println("");
Scanner animalArmadillio = new Scanner(System.in);
animalrock = animalArmadillio.next();
if(showbreed.contains("Yes"))
{
System.out.println("Well done he is happy and he rolled around!");
}
if(animalrock.contains("No"))
{
System.out.println("Go see the next animal");
}
animalArmadillio.close();
}
case "Deer":
if(showbreed.contains("Deer"))
{
System.out.println("Here comes" + " " + deer.name + " " + "he is really fast and he is" + " " + deer.age + " " + "years old. His habitat is the" + " " + deer.enviroment);
System.out.println("");
System.out.println("Do you want to stroke him?");
System.out.println("");
Scanner animalDeer = new Scanner(System.in);
animalrut = animalDeer.next();
if(animalrut.contains("Yes"))
{
System.out.println("Well done he is galloping round!");
}
if(animalrut.contains("No"))
{
System.out.println("Go see the next animal");
}
animalDeer.close();
}
case "Toucan":
if(showbreed.contains("Toucan"))
{
System.out.println("Here comes" + " " + toucan.name + " " + "he has a very big beak and he is" + " " + toucan.age + " " + "years old. His habitat is the" + " " + toucan.enviroment);
System.out.println("");
System.out.println("Do you want to feel him?");
System.out.println("");
Scanner animalToucan = new Scanner(System.in);
animalfred = animalToucan.next();
if(showbreed.contains("Yes"))
{
System.out.println("Well done he is flying around!");
}
if(animalfred.contains("No"))
{
System.out.println("Go see the next animal");
}
animalToucan.close();
}
case "Snowyowl":
if(showbreed.contains("Snowyowl"))
{
System.out.println("Here comes" + " " + snowyowl.name + " " + "she is very fast when flying and she is" + " " + snowyowl.age + " " + "years old. Her habitat is the" + " " + snowyowl.enviroment);
System.out.println("");
System.out.println("Do you want to feel her?");
System.out.println("");
Scanner animalSnowyowl = new Scanner(System.in);
animalkate = animalSnowyowl.next();
if(animalkate.contains("Yes"))
{
System.out.println("Well done she is flying around!");
}
if(animalkate.contains("No"))
{
System.out.println("Go see the next animal");
}
animalSnowyowl.close();
}
case "Clownfish":
if(showbreed.contains("Clownfish"))
{
System.out.println("Here comes" + " " + clownfish.name + " " + "he is very colourful and he is" + " " + clownfish.age + " " + "years old. His habitat is the" + " " + clownfish.enviroment);
System.out.println("");
System.out.println("Do you want to feel him?");
System.out.println("");
Scanner animalClownfish = new Scanner(System.in);
animaljack = animalClownfish.next();
if(animaljack.contains("Yes"))
{
System.out.println("Well done he is swimming around!");
}
if(animaljack.contains("No"))
{
System.out.println("Go see the next animal");
}
animalClownfish.close();
}
case "Stingray":
if(showbreed.contains("Stingray"))
{
System.out.println("Here comes" + " " + stingray.name + " " + "he is very big and he is" + " " + stingray.age + " " + "years old. His habitat is the" + " " + stingray.enviroment);
System.out.println("");
System.out.println("Do you want to feel him?");
System.out.println("");
Scanner animalStingray = new Scanner(System.in);
animalsteve = animalStingray.next();
if(animalsteve.contains("Yes"))
{
System.out.println("Well done he is swimming around!");
}
if(animalsteve.contains("No"))
{
System.out.println("Go see the next animal");
}
animalStingray.close();
}
case "Cameleon":
if(showbreed.contains("Cameleon"))
{
System.out.println("Here comes" + " " + cameleon.name + " " + "she is very slow" + " " + cameleon.age + " " + "years old. Her habitat is the" + " " + cameleon.enviroment);
System.out.println("");
System.out.println("Do you want to touch her?");
System.out.println("");
Scanner animalCameleon = new Scanner(System.in);
animalchloe = animalCameleon.next();
if(animalchloe.contains("Yes"))
{
System.out.println("Well done she is chaning colour!");
}
if(animalchloe.contains("No"))
{
System.out.println("Go see the next animal");
}
animalCameleon.close();
}
case "Crocodile":
if(showbreed.contains("Crocodile"))
{
System.out.println("Here comes" + " " + crocodile.name + " " + "he has alot of teeth and he is" + " " + crocodile.age + " " + "years old. His habitat is the" + " " + crocodile.enviroment);
System.out.println("");
System.out.println("Do you want to touch him?");
System.out.println("");
Scanner animalCrocodile = new Scanner(System.in);
animalkevin = animalCrocodile.next();
if(animalkevin.contains("Yes"))
{
System.out.println("Well done he is smiling!");
}
if(animalkevin.contains("No"))
{
System.out.println("Go see the next animal");
}
animalCrocodile.close();
}
}
console.close();
uni.close();
}
} }
\ 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