When the case is called, the user doesn't get a chance to input either the drug name or the barcode. For some reason, Java skips over that portion and calls the function, searches through it, and returns that nothing is found.
public static void main(String[] args) {
readCSV("C:\\CSVDemo.csv");
Scanner sc=new Scanner(System.in);
System.out.print("Please enter a number associated with the correct task."
+ "\n1: Search by barcode. \n2: Search by drug name. \n");
int chooseCase=sc.nextInt();
switch (chooseCase) {
case 1:
System.out.println("Please enter the barcode that you wish to search: ");
String userInput = sc.nextLine();
searchBarcode(userInput);
break;
case 2:
System.out.println("Please enter the drug name that you wish to search: ");
userInput = sc.nextLine();
searchDrugList(userInput);
break;
}
}