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.

46 lines
949 B

  1. package com.ugsbo.auslandssemester;
  2. public class Sitzung {
  3. private String name;
  4. private String vorname;
  5. private int inMonaten;
  6. private String destination;
  7. // Konstruktor mit Übergabewerten
  8. public Sitzung(String nachname, String vor, int monate, String ziel) {
  9. this.name = nachname;
  10. this.vorname = vor;
  11. this.inMonaten = monate;
  12. this.destination = ziel;
  13. }
  14. public String kategorieDestination() {
  15. String kategorie = "Europa";
  16. if (destination == "Australien" || destination == "Neuseeland" || destination == "Asien") {
  17. kategorie = "Asien";
  18. }
  19. if (destination == "USA") {
  20. kategorie = "USA";
  21. }
  22. return kategorie;
  23. }
  24. public int kategorieInMonaten() {
  25. int kategorie = 4; // alles was größer als 12 Monate ist
  26. if (inMonaten <= 2) {
  27. kategorie = 1;
  28. }
  29. if (inMonaten > 2 && inMonaten <= 5) {
  30. kategorie = 2;
  31. }
  32. if (inMonaten > 5 && inMonaten <= 12) {
  33. kategorie = 3;
  34. }
  35. return kategorie;
  36. }
  37. }