body of j2_app.java

class j2_app {
public static void main (String[] args) {
int menueingabe;
char t_input;
String tabelle;
menueingabe = 0;
while (menueingabe != 5) {
do {
System.out.println (“1 Datensatz anlegen\n2 Datensatz bearbeiten\n3 Datensatz loeschen\n4 Tabelle anzeigen\n5 Programm beenden\n”);
try {
menueingabe = eingabe.readInt(“Ihre Wahl:”);
}
catch (NumberFormatException e) {
System.out.println(“NumberFormatException in main”);
}
} while ((menueingabe != 1) && (menueingabe != 2) && (menueingabe != 3) && (menueingabe != 4) && (menueingabe != 5));
if (menueingabe != 5) {
do {
System.out.println (“Tabelle:\ns server\nu user\n”);
t_input = eingabe.readChar (“Ihre Wahl:”);
} while ((t_input != (‘s’)) && (t_input != (‘u’)));
switch (t_input){
case ‘s’ : tabelle = “server”; break;
case ‘u’ : tabelle = “user”; break;
default: tabelle = “not_defined”;
System.out.println (“caught”);
}
switch (menueingabe) {
case 1: System.out.println(“eins”);
System.out.println (tabelle);
if (t_input==’s’) {
}
else {
}
break;
case 2: System.out.println (“zwei”);
System.out.println (tabelle);
if (t_input==’s’) {
}
else {
}
break;
case 3: System.out.println (“drei”);
System.out.println (tabelle);
if (t_input==’s’) {
}
else {
}
break;
case 4: System.out.println (“vier”);
System.out.println (tabelle);
if (t_input==’s’) {
}
else {
}
break;
default: System.out.println(“caught”);
}
}
System.out.println();
}
System.out.println (“Programm wird beendet”);
}
}

Advertisements

About this entry