diff --git a/out/production/VPR_SCRIPT/Execute.class b/out/production/VPR_SCRIPT/Execute.class index 9c1b126..784d629 100644 Binary files a/out/production/VPR_SCRIPT/Execute.class and b/out/production/VPR_SCRIPT/Execute.class differ diff --git a/src/Execute.java b/src/Execute.java index 3b7a44d..83577d1 100644 --- a/src/Execute.java +++ b/src/Execute.java @@ -6,52 +6,62 @@ import java.util.Scanner; */ public class Execute { public static void main(String[] args) { - Data datei = new Data("users.txt"); - ArrayList user = datei.readUser(); - for (User user1 : user) { - System.out.println(user1); - } - System.out.println(); - System.out.println("\t\t\tANMELDUNG"); - int i = 0; - Scanner leser = new Scanner(System.in); + Data data = new Data("menue.txt"); - while (true) { + ArrayList menue = data.readMenue(); - - System.out.print("Name: "); - boolean error = false; - String name = leser.nextLine(); - error = isError(error, name); - System.out.print("Passwort: "); - String password = leser.nextLine(); - error = isError(error, password); - - - for (User user1 : user) { - if (!error) { - if (user1.getPassword().equals(password) && user1.getPhonenumber().equals(name)) { - System.out.println(); - System.out.println("Herzlich Willkommen " + user1.getNameParent1() + " und " + user1.getNameParent2() + ", Ihr Login war erfolgreich!"); - i++; - break; - - } else if (!(user1.getPassword().equals(password) && user1.getPhonenumber().equals(name))) { - System.out.println("Login fehlgeschlagen. Versuchen Sie es erneut."); - break; - } - - }else{ - System.out.println("Bitte Anmeldedaten angeben."); - break; - } - } - if (i > 0) { - break; - } + for (Menue m : menue) { + System.out.println(m); } } +// Data datei = new Data("users.txt"); +// ArrayList user = datei.readUser(); +// +// for (User user1 : user) { +// System.out.println(user1); +// } +// System.out.println(); +// System.out.println("\t\t\tANMELDUNG"); +// int i = 0; +// Scanner leser = new Scanner(System.in); +// +// while (true) { +// +// +// System.out.print("Name: "); +// boolean error = false; +// String name = leser.nextLine(); +// error = isError(error, name); +// System.out.print("Passwort: "); +// String password = leser.nextLine(); +// error = isError(error, password); +// +// +// for (User user1 : user) { +// if (!error) { +// if (user1.getPassword().equals(password) && user1.getPhonenumber().equals(name)) { +// System.out.println(); +// System.out.println("Herzlich Willkommen " + user1.getNameParent1() + " und " + user1.getNameParent2() + ", Ihr Login war erfolgreich!"); +// +// i++; +// break; +// +// } else if (!(user1.getPassword().equals(password) && user1.getPhonenumber().equals(name))) { +// System.out.println("Login fehlgeschlagen. Versuchen Sie es erneut."); +// break; +// } +// +// }else{ +// System.out.println("Bitte Anmeldedaten angeben."); +// break; +// } +// } +// if (i > 0) { +// break; +// } +// } +// } private static boolean isError(boolean error, String name) { if (name.isEmpty()) {