Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Auswahl {
- public static void main(String[] args) {
- Scanner scanner = new Scanner (System.in);
- int[] speicher = new int [9];
- for(int i=0;i<9;i++)
- speicher[i] = scanner.nextInt();
- zeigeMenue();
- switch(scanner.nextInt()) {
- case 1:
- for(int j=0;j<7;j++)
- System.out.println(speicher[j]);
- case 2:
- System.out.println(speicher[7]);
- case 3:
- System.out.println(speicher[8]);
- case 4:
- break;
- default:
- }
- }
- public static void zeigeMenue() {
- System.out.println("(1) Zeige die 1. bis 7. eingegebene Zahl");
- System.out.println("(2) Zeige die achte eingegebene Zahl");
- System.out.println("(3) Zeige die neunte eingegebene Zahl");
- System.out.println("(4) Beende das Programm");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement