-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenue.java
More file actions
49 lines (44 loc) · 1.58 KB
/
menue.java
File metadata and controls
49 lines (44 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* Dieses kleine Java-Programm erzeugt ein sehr einfaches
* Konsolen-Menü und dient dazu die Arbeitsweise eines RCS
* zu erklären.
* Autor(en): Michael Sauer
* Datum: 03.01.2014
* Datum: 28.11.2014 //fuer Veraenderung zu demonstrieren
* Compile: javac menue.java
* Execute: java menu
*/
import java.util.Scanner;
public class menue{
public static void main(String[] args) {
final int PROGRAMMENDE =0;
final int MICHAEL_SAUER =1;
final int MIKE_SOUR =2;
final int MATHIAS_W =3;
boolean isEnde =false;
String[] textfeld={"Ciao",
"Michael Sauer",
"Mike Sour",
"Mathias W."};
while(!isEnde){
Scanner scanner = new Scanner(System.in);
int wahl = scanner.nextInt();
switch (wahl) {
case PROGRAMMENDE:
System.out.println(textfeld[0]);
isEnde=true;
break;
case MICHAEL_SAUER:
System.out.println("Michael Sauer");
break;
case MIKE_SOUR:
System.out.println("Mike Sour");
break;
case MATHIAS_W
System.out.println("Mathias Wittling");
default:
System.out.println("Fehler: Kenne ich nicht!");
}
}
}
}