[Added] initial project
This commit is contained in:
commit
d52f770cf1
12 changed files with 332 additions and 0 deletions
38
src/com/ing/zoo/Zoo.java
Normal file
38
src/com/ing/zoo/Zoo.java
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
package com.ing.zoo;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Zoo {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
String[] commands = new String[4];
|
||||
commands[0] = "hello";
|
||||
commands[1] = "give leaves";
|
||||
commands[2] = "give meat";
|
||||
commands[3] = "perform trick";
|
||||
|
||||
Lion henk = new Lion();
|
||||
henk.name = "henk";
|
||||
Hippo elsa = new Hippo();
|
||||
elsa.name = "elsa";
|
||||
Pig dora = new Pig();
|
||||
dora.name = "dora";
|
||||
Tiger wally = new Tiger();
|
||||
wally.name = "wally";
|
||||
Zebra marty = new Zebra();
|
||||
marty.name = "marty";
|
||||
|
||||
Scanner scanner = new Scanner(System.in);
|
||||
System.out.print("Voer uw command in: ");
|
||||
|
||||
String input = scanner.nextLine();
|
||||
if(input.equals(commands[0] + " henk"))
|
||||
{
|
||||
henk.sayHello();
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.println("Unknown command: " + input);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in a new issue