import java.util.*;
public class Ship {
//variables
protected ArrayList<Container> Containers = new ArrayList<Container>();
protected boolean more=true;
ContainerCargo CC = new ContainerCargo("I1", "PEIRAEUS", 1);
ContainerRefridgerator CR = new ContainerRefridgerator("I2", "PIRAEUS", 1);
Scanner Keyboard = new Scanner(System.in);
while (more) {
System.out.println("What kind of ship do you want to add? 1: CARGO, 2: REFRIDGERATOR");
int answer = Keyboard.nextInt();
Keyboard.nextLine();
int ship = 1;
switch (ship) {
case 1:
System.out.println("You select CARGO conatiner");
CC.printInfo();
Containers.add(CC);
break;
case 2:
System.out.println("You select REFRIGERATOR");
CR.printinfo();
Containers.add(CR);
break;
default:
System.out.println("You didn't enlist other container");
}
Keyboard.nextLine();
System.out.println("More container? (y/n)");
String moreContainer = Keyboard.nextLine();
if(moreContainer.equals("n"))
more = false;
}
}