25 lines
611 B
Java
25 lines
611 B
Java
public class Verzweigung {
|
|
public static void main(String args[]){
|
|
int alter = 75;
|
|
|
|
if ( alter < 20 ) {
|
|
System.out.println("Du bist aber noch jung!");
|
|
}
|
|
else if ( alter < 30) {
|
|
System.out.println("Ist noch ok!");
|
|
}
|
|
else if (alter < 40 ) {
|
|
System.out.println("Grenzwertig :-P");
|
|
}
|
|
else if ( alter < 50) {
|
|
System.out.println("Die Rente ist in Sicht");
|
|
}
|
|
else if ( alter < 60 ) {
|
|
System.out.println("Bist du aber alt!");
|
|
}
|
|
else {
|
|
System.out.println("Na, ganz frisch bist du auch nicht mehr!");
|
|
}
|
|
|
|
}
|
|
} |