mardi 18 juillet 2017

Failed to use string in if statements

Hello sorry for this bold question but im not sure how to solve my needs on line 24 and 30 in the code. Also im getting error messages on line 33 and 22 so it would be awesome if you could solve those.

import java.util.Scanner;

public class CheckOrder {

public static Scanner userInput = new Scanner(System.in);
public static Scanner userInputStarters = new Scanner(System.in);

public static String menu;
public static String check;
public static String TheRestroom = "The Restroom";
public static String Restroom = "Restroom";
public static String Eat = "Eat";
public static String ToEat = "To Eat";
public static String restOrEat;


public static void main(String[] args) {

    System.out.print("Hello and Welcome to the SOMETHING restaurant. Would you like to eat or use the restroom?");
    public static restOrEat = userInput.NextInt();

    if (restOrEat.equalsIgnoreCase(TheRestroom || Restroom)) {

        System.out.println("Please go ahead to the restroom, it's over there.");
        System.exit(1);
    }

    if (restOrEat.equalsIgnoreCase(Eat || ToEat)) {

        System.out.print("What would you like to eat for starters? Press 1 for Cheese & Bacon, 2 for Sald (With options) and 3 for noodles");
        public static String starter = userInputStarters;

    }


}

}

Aucun commentaire:

Enregistrer un commentaire