From de612bdae175a94ede43acf816c977f382cc3ec4 Mon Sep 17 00:00:00 2001 From: Berat Date: Sun, 6 Oct 2024 00:43:09 +0200 Subject: [PATCH] UI loop --- PR2GitDemo/src/defaultt/TUI.java | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 PR2GitDemo/src/defaultt/TUI.java diff --git a/PR2GitDemo/src/defaultt/TUI.java b/PR2GitDemo/src/defaultt/TUI.java new file mode 100644 index 0000000..aa20c9b --- /dev/null +++ b/PR2GitDemo/src/defaultt/TUI.java @@ -0,0 +1,35 @@ +package defaultt; +import java.util.Scanner; + + +public class TUI extends Main{ + + + public static void main(String[] args){ + + Scanner sc = new Scanner(System.in); + while(true) { + System.out.println("(1) Einfahren"); + System.out.println("(2) Ausfahren"); + System.out.println("(3) Bezahlung"); + System.out.println("(4) Beenden"); + + int nutzerEingabe = sc.nextInt(); + sc.nextLine(); + + switch (nutzerEingabe) { + case 1: + Main.einfahrtUI(); + break; + case 2: + Main.ausfahrtUI(); + break; + case 3: + Main.zahlungUI(); + break; + case 4: + return; + } + } + } +}