While loop
Finns det någon vänlig själ som vill hjälpa mig med att hitta felet i min while-sats?
Jag har suttit för länge och hittar inte felet, förhoppningsvis så kan någon pigg och fräsch individ hitta det.
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
boolean notquit = true;
Apple aaa = new Apple();
Orange ooo = new Orange();
Pear ppp = new Pear();
while(notquit) {
String functionChoice = sc.next();
System.out.println("What do you want to do? Print sales, waste, thrown, sold or quit");
if(functionChoice.equalsIgnoreCase("sales")) {
TotalSales one = new TotalSales();
} else if(functionChoice.equalsIgnoreCase("waste")) {
TotalWaste uno = new TotalWaste();
} else if(functionChoice.equalsIgnoreCase("total")) {
System.out.println("You selected sold, which one? Print apple, pear or orange.");
} if(functionChoice.equalsIgnoreCase("apple")) {
aaa.importTotal("C:\\Users\\mtrum\\OneDrive\\Skrivbord\\text\\Soldapple.txt\\");
} else if(functionChoice.equalsIgnoreCase("orange")) {
ooo.importTotal("C:\\Users\\mtrum\\OneDrive\\Skrivbord\\text\\Soldorange.txt\\");
} else if(functionChoice.equalsIgnoreCase("pear")) {
ppp.importTotal("C:\\Users\\mtrum\\OneDrive\\Skrivbord\\text\\soldpear.txt\\");
} else if(functionChoice.equalsIgnoreCase("thrown")) {
System.out.println("Which fruit?");
} if(functionChoice.equalsIgnoreCase("apple")) {
aaa.importTotal("C:\\Users\\mtrum\\OneDrive\\Skrivbord\\text\\thrownapple.txt\\");
} else if(functionChoice.equalsIgnoreCase("orange")) {
ooo.importTotal("C:\\Users\\mtrum\\OneDrive\\Skrivbord\\text\\thrownorange.txt\\");
} else if(functionChoice.equalsIgnoreCase("pear")) {
ppp.importTotal("C:\\Users\\mtrum\\OneDrive\\Skrivbord\\text\\thrownpear.txt\\");
}else if(functionChoice.equalsIgnoreCase("quit")) {
notquit = false;
}
}
}
}
Mvh