Commit 580246cd authored by Tom's avatar Tom

first

parents
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk-13.0.2">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Zoo_Thomas_Barraclough</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>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=12
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=12
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=12
import java.util.ArrayList;
public class animals {
String species;
String food;
String enviroment;
String type;
ArrayList<animals> animalsArray = new ArrayList<animals>();
public animals(String species, String food, String enviroment, String type) {
this.species = species;
this.food = food;
this.enviroment = enviroment;
this.type = type;
}
public void addAnimal(animals ann) {
animalsArray.add(ann);
}
public void allAnimals() {
animals lion = new animals("Lion", "Meat", "Grasslands", "Mammal");
addAnimal(lion);
System.out.print(species);
}
}
import java.util.ArrayList;
public class methods {
public void allAnimals() {
}
}
import java.util.Arrays;
import java.util.Scanner;
public class zoo{
static Scanner input = new Scanner(System.in);
public static void main(String[] args) {
int w = 1;
while(w == 1) {
int menuChoice;
methods zoo = new methods();
//Creating the menu screen
System.out.print("York St John Zoo: Menu\n\nPlease select the number of the section you would like to view!\n\n1: View Individual Animal.\n2. Display"
+ " the details of each animal.\n3. View animal of particular type.\n4. Display the food required for all animals.\n5. Exit program\n");
menuChoice = input.nextInt();
switch(menuChoice) {
case 1:
case 2:
zoo.allAnimals();
break;
case 3:
case 4:
break;
case 5:
System.out.println("\nExiting Program!");
System.exit(0);
}
}}
}
\ 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