Ultra Geile Studenten Benutzer Oberfläche (UGSBO)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
971 B

  1. /**
  2. *
  3. */
  4. package com.ugsbo.entscheider;
  5. import java.util.Scanner;
  6. import java.util.*;
  7. /**
  8. * @author bruec
  9. *
  10. */
  11. public class Entscheider {
  12. /**
  13. * @param args
  14. */
  15. public static void main(String[] args) {
  16. System.out.println(pruefen(2));
  17. }
  18. public static String ergebnis(int a, int b, int c, int d, int e, int f, int g, int h) {
  19. return "";
  20. }
  21. public static String fragen() {
  22. return "";
  23. }
  24. public static int skalaTest(int answer){
  25. return 0;
  26. }
  27. public static int getAnInteger() {
  28. Scanner in = new Scanner(System.in);
  29. while (true){
  30. try{
  31. return in.nextInt();
  32. }
  33. catch (InputMismatchException e){
  34. in.next();
  35. System.out.println("Das ist kein Integer. Try again.");
  36. }
  37. }
  38. }
  39. public static int pruefen(int answer) {
  40. System.out.println("Try again. Nur 1 und 0 sind erlaubt.");
  41. Scanner in = new Scanner(System.in);
  42. int b = getAnInteger();
  43. if(b == 1 || b == 0) {
  44. return b;
  45. }
  46. pruefen(b);
  47. return 1;
  48. }
  49. }