You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
924 B

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
private static ArrayList<PackageInfo> packageList=new ArrayList<>();
public static void main(String[] args) {
TextMenu menu=new TextMenu();
do{
menu.display();
System.out.println("choose an option between 1 and 7:");
Scanner scan = new Scanner(System.in);
int option=Integer.parseInt(scan.nextLine());
if (option > 7 || option < 1){
System.out.println("invalid input");
}
else if(option == 7){
break;
}
else{
switch(option){
case 1: menu.list(packageList);
case 2: menu.add(packageList);
case 3: menu.remove(packageList);
case 4: menu.overDueList(packageList);
case 5: menu.upcomingList(packageList);
case 6: menu.markDelivered(packageList);
}
}
}
while (true);
}
}