AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Erstellen eines Datum-überprüfers

Ein Thema von Mo53 · begonnen am 16. Mai 2021 · letzter Beitrag vom 17. Mai 2021
 
Benutzerbild von KodeZwerg
KodeZwerg

Registriert seit: 1. Feb 2018
3.691 Beiträge
 
Delphi 11 Alexandria
 
#34

AW: Erstellen eines Datum-überprüfers

  Alt 16. Mai 2021, 23:46
a, b, c, d, e, f: integer;
Und was bedeuten diese Variablen-Namen??? Gewöhne es dir bitte ab das so zu schreiben, die Mitglieder hier würden es dir danken!

Da es anscheinend auch noch nicht gestattet ist eigene Methoden zu entwerfen, hier als Fließtext Programm:
Delphi-Quellcode:
program Project33;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils;

var
  iJahr, iMonat, iTag, iVollmond, iVollmonde, iSonntag, iMetonischerZyklus, iJahrhundert, iSchaltjahre, iMondPhase: Integer;
begin
  try
    Write('Jahr zur Berechnung des Ostersonntags eingeben: ');
    Readln(iJahr);
    iMetonischerZyklus := (iJahr mod 19) + 1;
    iJahrhundert := (iJahr div 100) + 1;
    iSchaltjahre := (3 * iJahrhundert) div 4 - 12;
    iMondPhase := (8 * iJahrhundert + 5) div 25 - 5;
    iSonntag := (5 * iJahr) div 4 - iSchaltjahre - 10; // überlaufschutz
    iVollmonde := (11 * iMetonischerZyklus + 20 + iMondPhase - iSchaltjahre) mod 30;
    if iVollmonde < 0 then
      iVollmonde := iVollmonde + 30;
    if ((iVollmonde = 25) and (iMetonischerZyklus > 11)) or (iVollmonde = 24) then
      iVollmonde := iVollmonde + 1;
    iVollmond := 44 - iVollmonde;
    if iVollmond < 21 then
      iVollmond := iVollmond + 30;
    iVollmond := iVollmond + 7 - ((iSonntag + iVollmond) mod 7);
    if iVollmond > 31 then
    begin
      iMonat := 4;
      iTag := iVollmond - 31;
    end
    else
    begin
      iMonat := 3;
      iTag := iVollmond;
    end;
    Writeln('Ostersonntag war/ist am ' + IntToStr(iTag) + '.' + IntToStr(iMonat) + '.' + IntToStr(iJahr));
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
  Readln;
end.
Gruß vom KodeZwerg
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 15:46 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz