Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Aufgabe {
- public static void main (String [] args) {
- Scanner sc= new Scanner (System.in);
- int auswahl;
- System.out.println (
- "1 Umrechnung in Meilen\n"
- + "2 Tabelle Kilometer in Meilen\n"
- + "3 Fertig\n"
- + "----------------------\n");
- do
- {
- System.out.println ("Bitte wählen Sie eine der drei Möglichkeiten aus");
- auswahl = sc.nextInt();
- }
- while (auswahl <1 || auswahl >3);
- switch (auswahl) {
- case 1: auswahl=1; System.out.println ("Umrechnung in Meilen"); break;
- case 2: auswahl=2; System.out.println ("Tabelle Kilometer in Meilen"); break;
- case 3: auswahl=3; System.out.println ("Fertig"); break;
- }
- sc.close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement