lundi 28 mars 2016

java skipping over if else statement

I'm a new programmer so it isn't very good. I made a program that allows the user to make a cheeseburger and then asks if they want a side item and then asks if they want to order another cheeseburger. When I run the program it skips over the last if else statement which is

System.out.println("Would you like to order another cheeseburger? Type yes or no.");
//function to calculate ordering another cheeseburger
String orderAnother = sc.nextLine();
if (orderAnother.equalsIgnoreCase("yes")) {
    System.out.println("Great! Another cheeseburger is on its way!");
} else {
    System.out.println("Okay! Thanks for stopping at The Burger Shack and have a great day!");
}

Is there something wrong that I can't figure out? Help is appreciated!

Aucun commentaire:

Enregistrer un commentaire