Commit 00b4d245 authored by luke.scott's avatar luke.scott

initial commit

parents
{
"java.project.sourcePaths": ["src"],
"java.project.outputPath": "bin",
"java.project.referencedLibraries": [
"lib/**/*.jar"
]
}
## 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
import java.util.Scanner;
class Main {
public static void main(String[] args) {
//string variable
String showSpecies;
String showtype;
String petzara;
String petceaser;
String pettom;
String petdave;
String petbob;
String petalex;
String petgary;
String petpaul;
//mammla class to enter animal info
class mammal
{
String name;
String food;
String enviroment;
String numzoo;
}
mammal dog = new mammal();
dog.name = "Zara";
dog.food = "kibble";
dog.enviroment = "house";
dog.numzoo ="100";
//animal.number
mammal ape = new mammal();
ape.name = "Ceaser";
ape.food = "berries";
ape.enviroment = "jungle";
ape.numzoo ="7";
//bird class to enter animal info
class birds
{
String name;
String food;
String enviroment;
String numzoo;
}
birds goose = new birds();
goose.name = "Tom";
goose.food = "fish";
goose.enviroment = "pond";
goose.numzoo ="56";
birds dove = new birds();
dove.name = "Dave";
dove.food = "worms";
dove.enviroment = "trees";
dove.numzoo ="2";
//fish class to enter animal info
class fish
{
String name;
String food;
String enviroment;
String numzoo;
}
fish blobfish = new fish();
blobfish.name = "Bob";
blobfish.food = "fish";
blobfish.enviroment = "ocean";
blobfish.numzoo ="100";
fish siamesefightingfish = new fish();
siamesefightingfish.name = "Alex";
siamesefightingfish.food = "fish";
siamesefightingfish.enviroment = "ocean";
siamesefightingfish.numzoo ="86";
//reptile class to enter animal info
class reptile
{
String name;
String food;
String enviroment;
String numzoo;
}
reptile crocodile = new reptile();
crocodile.name = "Gary";
crocodile.food = "fish";
crocodile.enviroment = "swamp";
crocodile.numzoo ="14";
reptile geckos = new reptile();
geckos.name = "Paul";
geckos.food = "insects";
geckos.enviroment = "mountains";
geckos.numzoo ="9";
//Scanner for user imput
Scanner console = new Scanner(System.in);
//Startof user input
System.out.println("Welcome to my Zoo!");
System.out.println("");
System.out.println("Which animal type would you like to see?");
System.out.println("");
System.out.println("Mammal");
System.out.println("");
System.out.println("Bird");
System.out.println("");
System.out.println("Fish");
System.out.println("");
System.out.println("Reptile");
System.out.println("");
showSpecies = console.next();
//Takes users input and directs them to corret species of animal
switch (showSpecies)
{
case "Mammal" :
if(showSpecies.contains("Mammal"))
{
System.out.println("");
System.out.println("Which mammal do you want to see?");
System.out.println("");
System.out.println("Dog");
System.out.println("Or");
System.out.println("Ape");
System.out.println("");
}
break;
case "Bird" :
if(showSpecies.contains("Bird"))
{
System.out.println("");
System.out.println("Which Bird would you like to see?");
System.out.println("");
System.out.println("Goose");
System.out.println("Or");
System.out.println("Dove");
System.out.println("");
}
break;
case "Fish" :
if(showSpecies.contains("Fish"))
{
System.out.println("");
System.out.println("Which fish would you like to see?");
System.out.println("");
System.out.println("Blobfish");
System.out.println("Or");
System.out.println("Siamese Fighting Fish");
System.out.println("");
;
}
break;
case "Reptile" :
if(showSpecies.contains("Reptile"))
{
System.out.println("");
System.out.println("Which Repltile would you like to see?");
System.out.println("");
System.out.println("Crocodile");
System.out.println("Or");
System.out.println("Geckos");
System.out.println("");
}
break;
}
//user input used again to direct them to the correct path. Will be unique dopedning on what they input
Scanner ysj = new Scanner(System.in);
showtype = ysj.next();
//Main case that will direct the user to the animal they have selected and print out the information from the animals class
//Will also let the user decide if they want to feed the animals or not
switch (showtype)
{
case "Dog":
if(showtype.contains("Dog"))
{
System.out.println("You are now with" + " " + dog.name + ", " + "she loves to eat" + " " + dog.food + " " + "and she live in the" + " " + dog.enviroment + ". " + "There is" + " " + dog.numzoo + " " + " dogs in our care.");
System.out.println("");
System.out.println("Do you want to feed Zara?");
System.out.println("");
Scanner petZara = new Scanner(System.in);
petzara = petZara.next();
if(petzara.contains("Yes"))
{
System.out.println("You give Zara some kibble from your hand and she wags her tail in joy!");
}
if(petzara.contains("No"))
{
System.out.println("Please move along!");
}
petZara.close();
}
case "Ape":
if(showtype.contains("Ape"))
{
System.out.println("You are now with" + " " + ape.name + ", " + "Ceaser loves to eat" + " " + ape.food + " " + "and him and his family live in the" +" " + ape.enviroment + ". " + "There is" + " " + ape.numzoo + " " + "apes in our care.");
System.out.println("");
System.out.println("Do you want to feed Ceaser?");
System.out.println("");
Scanner petCeaser = new Scanner(System.in);
petceaser = petCeaser.next();
if(petceaser.contains("Yes"))
{
System.out.println("Ceaser realy enjoyed his berries!");
}
if(petceaser.contains("No"))
{
System.out.println("Please move along");
}
petCeaser.close();
}
case "Goose":
if(showtype.contains("Goose"))
{
System.out.println("You are now with" + " " + goose.name + " " + ", he loves to eat" + " " + goose.food + " " + "and Tom lives in the" +" " + goose.enviroment + ". " + "There is" + " " + goose.numzoo + " " + "geese in our care.");
System.out.println("");
System.out.println("Do you want to feed Tom some fish?");
System.out.println("");
Scanner petTom = new Scanner(System.in);
pettom = petTom.next();
if (pettom.contains("Yes"))
{
System.out.println("You hand some fish over to Tom and he flaps his wings to say Thank You");
}
if (pettom.contains("No"))
{
System.out.println("Please move along!");
}
petTom.close();
}
case "Dove":
if(showtype.contains("Dove"))
{
System.out.println("You are now with" + " " + dove.name + ", " + "mainly eats" + " " + dove.food + " " + "and lives in the" +" " + dove.enviroment + ". " + "There is" + " " + dove.numzoo + " " + "doves in our care.");
System.out.println("");
System.out.println("Do you want to hand Dave some worms?");
System.out.println("");
Scanner petDave = new Scanner(System.in);
petdave = petDave.next();
if (petdave.contains("Yes"))
{
System.out.println("Dave really enjoyed his worms and even saved some for his children!");
}
if (petdave.contains("No"))
{
System.out.println("Please move along!");
}
petDave.close();
}
case "Blobfish":
if(showtype.contains("Blobfish"))
{
System.out.println("You are now with" + " " + blobfish.name + " " + "he lives in the" + " " + blobfish.enviroment + " " + "and mainly eats" +" " + blobfish.food + ". " + "There is" + " " + blobfish.numzoo + " " + "blobfish in our care.");
System.out.println("");
System.out.println("Do you want to feed Bob?");
System.out.println("");
Scanner petBob = new Scanner(System.in);
petbob = petBob.next();
if (petbob.contains("Yes"))
{
System.out.println("Bob throughly enjoyed his food and now needs to sleep.");
}
if (petbob.contains("No"))
{
System.out.println("Please move along!");
}
petBob.close();
}
case "Sieamesefightingfish":
if(showtype.contains("Sieamesefightingfish"))
{
System.out.println("You are now with" + " " + siamesefightingfish.name + " " + "he loves to eat" + " " + siamesefightingfish.food + " " + "and lives in the" +" " + siamesefightingfish.food + ". " + "There is" + " " + siamesefightingfish.numzoo + " " + "Siamese fighting fish in our care.");
System.out.println("");
System.out.println("Do you want to feed Alex?");
System.out.println("");
Scanner petAlex = new Scanner(System.in);
petalex = petAlex.next();
if (petalex.contains("Yes"))
{
System.out.println("Be careful, Alex is very fiesty! However he did really enjoy his food.");
}
if (petalex.contains("No"))
{
System.out.println("Please move along");
}
petAlex.close();
}
case "crocodile":
if(showtype.contains("crocodile"))
{
System.out.println("You are now with" + " " + crocodile.name + " " + "he lives in the" + " " + crocodile.enviroment + " " + "and loves to devour on" +" " + crocodile.food + ". " + "There is" + " " + crocodile.numzoo + " " + "crocodiles in our care.");
System.out.println("");
System.out.println("Do you want to Gary some fish?");
System.out.println("");
Scanner petGary = new Scanner(System.in);
petgary = petGary.next();
if (petgary.contains("Yes"))
{
System.out.println("Well done! You successfully gave Gary some fish and he is coming back for more.");
}
if (petgary.contains("No"))
{
System.out.println("Please move along!");
}
petGary.close();
}
case "Geckos":
if(showtype.contains("Geckos"))
{
System.out.println("You are now with" + " " + geckos.name + ", " + "he lives in the" + " " + geckos.enviroment + " " + "and usually loves to eat" +" " + geckos.food + ". " + "There is" + " " + geckos.numzoo + " " + "Geckos in our care.");
System.out.println("");
System.out.println("Do you want to feed Paul");
System.out.println("");
Scanner petPaul = new Scanner(System.in);
petpaul = petPaul.next();
if (petpaul.contains("Yes"))
{
System.out.println("You feed Paul some insects and he got scared so camoflauged into his surroundings.");
}
if (petpaul.contains("No"))
{
System.out.println("Please move along!");
}
petPaul.close();
}
}
console.close();
ysj.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