Subato

ButtonLogic 5

class DayOfWeekLogic extends ButtonLogic {
  @Override public String getButtonLabel(){
    return "Ostersonntag für Jahr berechnen ";
  }
  @Override public String eval(String x){
    String[] dates = x.trim().split("\\.");
    switch (new Date(new Integer(dates[0]),new Integer(dates[1]),new Integer(dates[2])).dayOfWeek()){
    case 0: return "Sonntag";
    case 1: return "Montag";
    case 2: return "Dienstag";
    case 3: return "Mittwoch";
    case 4: return "Donnerstag";
    case 5: return "Freitag";
    default: return "Sonnabend";
    }
  }

  public static void main(String[] args){
    //new Dialogue(new DayOfWeekLogic());
    new ConsoleDialogue(new DayOfWeekLogic()).run();
  }
}