WITH Ada. Text_IO ;

USE Ada. Text_IO ;

WITH Ada. Integer_Text_IO ;

USE Ada. Integer_Text_IO ;

PROCEDURE Kalendarz IS

Data : String ( 1 .. 20 ) ; -- data wprowadzana przez uzytkownika

Miejsce : Natural := 0 ; -- ilosc znakow daty wprowadzanej przez uzytkownika

Rok : Integer := 0 ; -- zmienna przechowywujaca przstepnosc roku

Miesiac : Integer := 0 ; -- zmienna informujaca o rodzaju miesiaca

Maly : Boolean := False; -- zmienna mowiaca czy uzytkownik podal date 31-12-9999

PODANO_ZBYT_DLUGI_LANCUCH_ZNAKOW : EXCEPTION ; -- wyjatek

ZLY_FORMAT : EXCEPTION ; -- wyjatek

-- procedura podajaca date nastepnego dnia

PROCEDURE PodajDate IS

BEGIN

CASE Miesiac IS

WHEN 1 =>

IF Data ( 1 ) IN ' 0 '..' 0 ' THEN

IF Data ( 2 ) IN ' 0 '..' 0 ' THEN

Data ( 2 ) :=' 1 ';

ELSIF Data ( 2 ) IN ' 1 '..' 1 ' THEN

Data ( 2 ) :=' 2 ';

ELSIF Data ( 2 ) IN ' 2 '..' 2 ' THEN

Data ( 2 ) :=' 3 ';

ELSIF Data ( 2 ) IN ' 3 '..' 3 ' THEN

Data ( 2 ) :=' 4 ';

ELSIF Data ( 2 ) IN ' 4 '..' 4 ' THEN

Data ( 2 ) :=' 5 ';

ELSIF Data ( 2 ) IN ' 5 '..' 5 ' THEN

Data ( 2 ) :=' 6 ';

ELSIF Data ( 2 ) IN ' 6 '..' 6 ' THEN

Data ( 2 ) :=' 7 ';

ELSIF Data ( 2 ) IN ' 7 '..' 7 ' THEN

Data ( 2 ) :=' 8 ';

ELSIF Data ( 2 ) IN ' 8 '..' 8 ' THEN

Data ( 2 ) :=' 9 ';

ELSIF Data ( 2 ) IN ' 9 '..' 9 ' THEN

Data ( 1 ) :=' 1 ';

Data ( 2 ) :=' 0 ';

END IF ;

ELSIF Data ( 1 ) IN ' 1 '..' 1 ' THEN

IF Data ( 2 ) IN ' 0 '..' 0 ' THEN

Data ( 2 ) :=' 1 ';

ELSIF Data ( 2 ) IN ' 1 '..' 1 ' THEN

Data ( 2 ) :=' 2 ';

ELSIF Data ( 2 ) IN ' 2 '..' 2 ' THEN

Data ( 2 ) :=' 3 ';

ELSIF Data ( 2 ) IN ' 3 '..' 3 ' THEN

Data ( 2 ) :=' 4 ';

ELSIF Data ( 2 ) IN ' 4 '..' 4 ' THEN

Data ( 2 ) :=' 5 ';

ELSIF Data ( 2 ) IN ' 5 '..' 5 ' THEN

Data ( 2 ) :=' 6 ';

ELSIF Data ( 2 ) IN ' 6 '..' 6 ' THEN

Data ( 2 ) :=' 7 ';

ELSIF Data ( 2 ) IN ' 7 '..' 7 ' THEN

Data ( 2 ) :=' 8 ';

ELSIF Data ( 2 ) IN ' 8 '..' 8 ' THEN

Data ( 2 ) :=' 9 ';

ELSIF Data ( 2 ) IN ' 9 '..' 9 ' THEN

Data ( 1 ) :=' 2 ';

Data ( 2 ) :=' 0 ';

END IF ;

ELSIF Data ( 1 ) IN ' 2 '..' 2 ' THEN

IF Data ( 2 ) IN ' 0 '..' 0 ' THEN

Data ( 2 ) :=' 1 ';

ELSIF Data ( 2 ) IN ' 1 '..' 1 ' THEN

Data ( 2 ) :=' 2 ';

ELSIF Data ( 2 ) IN ' 2 '..' 2 ' THEN

Data ( 2 ) :=' 3 ';

ELSIF Data ( 2 ) IN ' 3 '..' 3 ' THEN

Data ( 2 ) :=' 4 ';

ELSIF Data ( 2 ) IN ' 4 '..' 4 ' THEN

Data ( 2 ) :=' 5 ';

ELSIF Data ( 2 ) IN ' 5 '..' 5 ' THEN

Data ( 2 ) :=' 6 ';

ELSIF Data ( 2 ) IN ' 6 '..' 6 ' THEN

Data ( 2 ) :=' 7 ';

ELSIF Data ( 2 ) IN ' 7 '..' 7 ' THEN

Data ( 2 ) :=' 8 ';

ELSIF Data ( 2 ) IN ' 8 '..' 8 ' THEN

Data ( 2 ) :=' 9 ';

ELSIF Data ( 2 ) IN ' 9 '..' 9 ' THEN

Data ( 1 ) :=' 3 ';

Data ( 2 ) :=' 0 ';

END IF ;

ELSIF Data ( 1 ) IN ' 3 '..' 3 ' THEN

IF Data ( 2 ) IN ' 0 '..' 0 ' THEN

Data ( 2 ) :=' 1 ';

ELSIF Data ( 2 ) IN ' 1 '..' 1 ' THEN

Data ( 1 ) :=' 0 ';

Data ( 2 ) :=' 1 ';

IF Data ( 5 ) IN ' 1 '..' 1 ' AND Data ( 4 ) IN ' 0 '..' 0 ' THEN

Data ( 4 ) :=' 2 ';

ELSIF Data ( 5 ) IN ' 3 '..' 3 ' AND Data ( 4 ) IN ' 0 '..' 0 ' THEN

Data ( 4 ) :=' 4 ';

ELSIF Data ( 5 ) IN ' 5 '..' 5 ' AND Data ( 4 ) IN ' 0 '..' 0 ' THEN

Data ( 4 ) :=' 6 ';

ELSIF Data ( 5 ) IN ' 7 '..' 7 ' AND Data ( 4 ) IN ' 0 '..' 0 ' THEN

Data ( 4 ) :=' 8 ';

ELSIF Data ( 5 ) IN ' 8 '..' 8 ' AND Data ( 4 ) IN ' 0 '..' 0 ' THEN

Data ( 4 ) :=' 9 ';

ELSIF Data ( 4 ) IN ' 1 '..' 1 ' AND Data ( 5 ) IN ' 0 '..' 0 ' THEN

Data ( 4 ) :=' 1 ';

Data ( 5 ) :=' 0 ';

ELSIF Data ( 4 ) IN ' 1 '..' 1 ' AND Data ( 5 ) IN ' 2 '..' 2 ' THEN

Data ( 4 ) :=' 1 ';

Data ( 5 ) :=' 2 ';

IF Data ( 10 ) IN ' 0 '..' 0 ' THEN

Data ( 10 ) :=' 1 ';

ELSIF Data ( 10 ) IN ' 1 '..' 1 ' THEN

Data ( 10 ) :=' 2 ';

ELSIF Data ( 10 ) IN ' 2 '..' 2 ' THEN

Data ( 10 ) :=' 3 ';

ELSIF Data ( 10 ) IN ' 3 '..' 3 ' THEN

Data ( 10 ) :=' 4 ';

ELSIF Data ( 10 ) IN ' 4 '..' 4 ' THEN

Data ( 10 ) :=' 5 ';

ELSIF Data ( 10 ) IN ' 5 '..' 5 ' THEN

Data ( 10 ) :=' 6 ';

ELSIF Data ( 10 ) IN ' 6 '..' 6 ' THEN

Data ( 10 ) :=' 7 ';

ELSIF Data ( 10 ) IN ' 7 '..' 7 ' THEN

Data ( 10 ) :=' 8 ';

ELSIF Data ( 10 ) IN ' 8 '..' 8 ' THEN

Data ( 10 ) :=' 9 ';

ELSIF Data ( 10 ) IN ' 9 '..' 9 ' THEN

Data ( 10 ) :=' 0 ';

IF Data ( 9 ) IN ' 0 '..' 0 ' THEN

Data ( 9 ) :=' 1 ';

ELSIF Data ( 9 ) IN ' 1 '..' 1 ' THEN

Data ( 9 ) :=' 2 ';

ELSIF Data ( 9 ) IN ' 2 '..' 2 ' THEN

Data ( 9 ) :=' 3 ';

ELSIF Data ( 9 ) IN ' 3 '..' 3 ' THEN

Data ( 9 ) :=' 4 ';

ELSIF Data ( 9 ) IN ' 4 '..' 4 ' THEN

Data ( 9 ) :=' 5 ';

ELSIF Data ( 9 ) IN ' 5 '..' 5 ' THEN

Data ( 9 ) :=' 6 ';

ELSIF Data ( 9 ) IN ' 6 '..' 6 ' THEN

Data ( 9 ) :=' 7 ';

ELSIF Data ( 9 ) IN ' 7 '..' 7 ' THEN

Data ( 9 ) :=' 8 ';

ELSIF Data ( 9 ) IN ' 8 '..' 8 ' THEN

Data ( 9 ) :=' 9 ';

ELSIF Data ( 9 ) IN ' 9 '..' 9 ' THEN

Data ( 9 ) :=' 0 ';

IF Data ( 8 ) IN ' 0 '..' 0 ' THEN

Data ( 8 ) := ' 1 ';

ELSIF Data ( 8 ) IN ' 1 '..' 1 ' THEN

Data ( 8 ) := ' 2 ';

ELSIF Data ( 8 ) IN ' 2 '..' 2 ' THEN

Data ( 8 ) := ' 3 ';

ELSIF Data ( 8 ) IN ' 3 '..' 3 ' THEN

Data ( 8 ) := ' 4 ';

ELSIF Data ( 8 ) IN ' 4 '..' 4 ' THEN

Data ( 8 ) := ' 5 ';

ELSIF Data ( 8 ) IN ' 5 '..' 5 ' THEN

Data ( 8 ) := ' 6 ';

ELSIF Data ( 8 ) IN ' 6 '..' 6 ' THEN

Data ( 8 ) := ' 7 ';

ELSIF Data ( 8 ) IN ' 7 '..' 7 ' THEN

Data ( 8 ) := ' 8 ';

ELSIF Data ( 8 ) IN ' 8 '..' 8 ' THEN

Data ( 8 ) := ' 9 ';

ELSIF Data ( 8 ) IN ' 9 '..' 9 ' THEN

Data ( 8 ) := ' 0 ';

IF Data ( 7 ) IN ' 0 '..' 0 ' THEN

Data ( 7 ) := ' 1 ';

ELSIF Data ( 7 ) IN ' 1 '..' 1 ' THEN

Data ( 7 ) := ' 2 ';

ELSIF Data ( 7 ) IN ' 2 '..' 2 ' THEN

Data ( 7 ) := ' 3 ';

ELSIF Data ( 7 ) IN ' 3 '..' 3 ' THEN

Data ( 7 ) := ' 4 ';

ELSIF Data ( 7 ) IN ' 4 '..' 4 ' THEN

Data ( 7 ) := ' 5 ';

ELSIF Data ( 7 ) IN ' 5 '..' 5 ' THEN

Data ( 7 ) := ' 6 ';

ELSIF Data ( 7 ) IN ' 6 '..' 6 ' THEN

Data ( 7 ) := ' 7 ';

ELSIF Data ( 7 ) IN ' 7 '..' 7 ' THEN

Data ( 7 ) := ' 8 ';

ELSIF Data ( 7 ) IN ' 8 '..' 8 ' THEN

Data ( 7 ) := ' 9 ';

ELSIF Data ( 7 ) IN ' 9 '..' 9 ' THEN

Put_Line ( "Nie ma nastepnego dnia z powodu zbyt malego formatu daty." ) ;

Put_Line ( "Jesli jednak ma byc to data bedzie nastepujaca..." ) ;

Put_Line ( Data ( 1 .. 6 ) & "10000" ) ;

Maly:=True;

END IF ;

END IF ;

END IF ;

END IF ;

END IF ;

END IF ;

END IF ;

WHEN 2 =>

IF Data ( 1 ) IN ' 0 '..' 0 ' THEN

IF Data ( 2 ) IN ' 0 '..' 0 ' THEN

Data ( 2 ) :=' 1 ';

ELSIF Data ( 2 ) IN ' 1 '..' 1 ' THEN

Data ( 2 ) :=' 2 ';

ELSIF Data ( 2 ) IN ' 2 '..' 2 ' THEN

Data ( 2 ) :=' 3 ';

ELSIF Data ( 2 ) IN ' 3 '..' 3 ' THEN

Data ( 2 ) :=' 4 ';

ELSIF Data ( 2 ) IN ' 4 '..' 4 ' THEN

Data ( 2 ) :=' 5 ';

ELSIF Data ( 2 ) IN ' 5 '..' 5 ' THEN

Data ( 2 ) :=' 6 ';

ELSIF Data ( 2 ) IN ' 6 '..' 6 ' THEN

Data ( 2 ) :=' 7 ';

ELSIF Data ( 2 ) IN ' 7 '..' 7 ' THEN

Data ( 2 ) :=' 8 ';

ELSIF Data ( 2 ) IN ' 8 '..' 8 ' THEN

Data ( 2 ) :=' 9 ';

ELSIF Data ( 2 ) IN ' 9 '..' 9 ' THEN

Data ( 1 ) :=' 1 ';

Data ( 2 ) :=' 0 ';

END IF ;

ELSIF Data ( 1 ) IN ' 1 '..' 1 ' THEN

IF Data ( 2 ) IN ' 0 '..' 0 ' THEN

Data ( 2 ) :=' 1 ';

ELSIF Data ( 2 ) IN ' 1 '..' 1 ' THEN

Data ( 2 ) :=' 2 ';

ELSIF Data ( 2 ) IN ' 2 '..' 2 ' THEN

Data ( 2 ) :=' 3 ';

ELSIF Data ( 2 ) IN ' 3 '..' 3 ' THEN

Data ( 2 ) :=' 4 ';

ELSIF Data ( 2 ) IN ' 4 '..' 4 ' THEN

Data ( 2 ) :=' 5 ';

ELSIF Data ( 2 ) IN ' 5 '..' 5 ' THEN

Data ( 2 ) :=' 6 ';

ELSIF Data ( 2 ) IN ' 6 '..' 6 ' THEN

Data ( 2 ) :=' 7 ';

ELSIF Data ( 2 ) IN ' 7 '..' 7 ' THEN

Data ( 2 ) :=' 8 ';

ELSIF Data ( 2 ) IN ' 8 '..' 8 ' THEN

Data ( 2 ) :=' 9 ';

ELSIF Data ( 2 ) IN ' 9 '..' 9 ' THEN

Data ( 1 ) :=' 2 ';

Data ( 2 ) :=' 0 ';

ELSIF Data ( 1 ) IN ' 2 '..' 2 ' THEN

IF Data ( 2 ) IN ' 0 '..' 0 ' THEN

Data ( 2 ) :=' 1 ';

ELSIF Data ( 2 ) IN ' 1 '..' 1 ' THEN

Data ( 2 ) :=' 2 ';

ELSIF Data ( 2 ) IN ' 2 '..' 2 ' THEN

Data ( 2 ) :=' 3 ';

ELSIF Data ( 2 ) IN ' 3 '..' 3 ' THEN

Data ( 2 ) :=' 4 ';

ELSIF Data ( 2 ) IN ' 4 '..' 4 ' THEN

Data ( 2 ) :=' 5 ';

ELSIF Data ( 2 ) IN ' 5 '..' 5 ' THEN

Data ( 2 ) :=' 6 ';

ELSIF Data ( 2 ) IN ' 6 '..' 6 ' THEN

Data ( 2 ) :=' 7 ';

ELSIF Data ( 2 ) IN ' 7 '..' 7 ' THEN

Data ( 2 ) :=' 8 ';

ELSIF Data ( 2 ) IN ' 8 '..' 8 ' THEN

Data ( 2 ) :=' 9 ';

ELSIF Data ( 2 ) IN ' 9 '..' 9 ' THEN

Data ( 1 ) :=' 3 ';

Data ( 2 ) :=' 0 ';

ELSIF Data ( 1 ) IN ' 3 '..' 3 ' AND Data ( 2 ) IN ' 0 '..' 0 ' THEN

Data ( 1 ) :=' 0 ';

Data ( 2 ) :=' 1 ';

IF Data ( 4 ) IN ' 0 '..' 0 ' AND Data ( 5 ) IN ' 4 '..' 4 ' THEN

Data ( 5 ) :=' 5 ';

ELSIF Data ( 4 ) IN ' 0 '..' 0 ' AND Data ( 5 ) IN ' 6 '..' 6 ' THEN

Data ( 5 ) :=' 7 ';

ELSIF Data ( 4 ) IN ' 0 '..' 0 ' AND Data ( 5 ) IN ' 9 '..' 9 ' THEN

Data ( 4 ) :=' 1 ';

Data ( 5 ) :=' 0 ';

ELSIF Data ( 4 ) IN ' 1 '..' 1 ' AND Data ( 5 ) IN ' 1 '..' 1 ' THEN

Data ( 4 ) :=' 1 ';

Data ( 5 ) :=' 2 ';

END IF ;

END IF ;

END IF ;

END IF ;

WHEN 3 =>

IF Data ( 1 ) IN ' 0 '..' 0 ' THEN

IF Data ( 2 ) IN ' 0 '..' 0 ' THEN

Data ( 2 ) :=' 1 ';

ELSIF Data ( 2 ) IN ' 1 '..' 1 ' THEN

Data ( 2 ) :=' 2 ';

ELSIF Data ( 2 ) IN ' 2 '..' 2 ' THEN

Data ( 2 ) :=' 3 ';

ELSIF Data ( 2 ) IN ' 3 '..' 3 ' THEN

Data ( 2 ) :=' 4 ';

ELSIF Data ( 2 ) IN ' 4 '..' 4 ' THEN

Data ( 2 ) :=' 5 ';

ELSIF Data ( 2 ) IN ' 5 '..' 5 ' THEN

Data ( 2 ) :=' 6 ';

ELSIF Data ( 2 ) IN ' 6 '..' 6 ' THEN

Data ( 2 ) :=' 7 ';

ELSIF Data ( 2 ) IN ' 7 '..' 7 ' THEN

Data ( 2 ) :=' 8 ';

ELSIF Data ( 2 ) IN ' 8 '..' 8 ' THEN

Data ( 2 ) :=' 9 ';

ELSIF Data ( 2 ) IN ' 9 '..' 9 ' THEN

Data ( 1 ) :=' 1 ';

Data ( 2 ) :=' 0 ';

END IF ;

ELSIF Data ( 1 ) IN ' 1 '..' 1 ' THEN

IF Data ( 2 ) IN ' 0 '..' 0 ' THEN

Data ( 2 ) :=' 1 ';

ELSIF Data ( 2 ) IN ' 1 '..' 1 ' THEN

Data ( 2 ) :=' 2 ';

ELSIF Data ( 2 ) IN ' 2 '..' 2 ' THEN

Data ( 2 ) :=' 3 ';

ELSIF Data ( 2 ) IN ' 3 '..' 3 ' THEN

Data ( 2 ) :=' 4 ';

ELSIF Data ( 2 ) IN ' 4 '..' 4 ' THEN

Data ( 2 ) :=' 5 ';

ELSIF Data ( 2 ) IN ' 5 '..' 5 ' THEN

Data ( 2 ) :=' 6 ';

ELSIF Data ( 2 ) IN ' 6 '..' 6 ' THEN

Data ( 2 ) :=' 7 ';

ELSIF Data ( 2 ) IN ' 7 '..' 7 ' THEN

Data ( 2 ) :=' 8 ';

ELSIF Data ( 2 ) IN ' 8 '..' 8 ' THEN

Data ( 2 ) :=' 9 ';

ELSIF Data ( 2 ) IN ' 9 '..' 9 ' THEN

Data ( 1 ) :=' 2 ';

Data ( 2 ) :=' 0 ';

END IF ;

ELSIF Data ( 1 ) IN ' 2 '..' 2 ' THEN

IF Data ( 2 ) IN ' 0 '..' 0 ' THEN

Data ( 2 ) :=' 1 ';

ELSIF Data ( 2 ) IN ' 1 '..' 1 ' THEN

Data ( 2 ) :=' 2 ';

ELSIF Data ( 2 ) IN ' 2 '..' 2 ' THEN

Data ( 2 ) :=' 3 ';

ELSIF Data ( 2 ) IN ' 3 '..' 3 ' THEN

Data ( 2 ) :=' 4 ';

ELSIF Data ( 2 ) IN ' 4 '..' 4 ' THEN

Data ( 2 ) :=' 5 ';

ELSIF Data ( 2 ) IN ' 5 '..' 5 ' THEN

Data ( 2 ) :=' 6 ';

ELSIF Data ( 2 ) IN ' 6 '..' 6 ' THEN

Data ( 2 ) :=' 7 ';

ELSIF Data ( 2 ) IN ' 7 '..' 7 ' THEN

Data ( 2 ) :=' 8 ';

ELSIF Data ( 2 ) IN ' 8 '..' 8 ' THEN

Data ( 2 ) :=' 9 ';

ELSIF Data ( 2 ) IN ' 9 '..' 9 ' THEN

Data ( 1 ) :=' 0 ';

Data ( 2 ) :=' 1 ';

Data ( 5 ) :=' 3 ';

END IF ;

END IF ;

WHEN 4 =>

IF Data ( 1 ) IN ' 0 '..' 0 ' THEN

IF Data ( 2 ) IN ' 0 '..' 0 ' THEN

Data ( 2 ) :=' 1 ';

ELSIF Data ( 2 ) IN ' 1 '..' 1 ' THEN

Data ( 2 ) :=' 2 ';

ELSIF Data ( 2 ) IN ' 2 '..' 2 ' THEN

Data ( 2 ) :=' 3 ';

ELSIF Data ( 2 ) IN ' 3 '..' 3 ' THEN

Data ( 2 ) :=' 4 ';

ELSIF Data ( 2 ) IN ' 4 '..' 4 ' THEN

Data ( 2 ) :=' 5 ';

ELSIF Data ( 2 ) IN ' 5 '..' 5 ' THEN

Data ( 2 ) :=' 6 ';

ELSIF Data ( 2 ) IN ' 6 '..' 6 ' THEN

Data ( 2 ) :=' 7 ';

ELSIF Data ( 2 ) IN ' 7 '..' 7 ' THEN

Data ( 2 ) :=' 8 ';

ELSIF Data ( 2 ) IN ' 8 '..' 8 ' THEN

Data ( 2 ) :=' 9 ';

ELSIF Data ( 2 ) IN ' 9 '..' 9 ' THEN

Data ( 1 ) :=' 1 ';

Data ( 2 ) :=' 0 ';

END IF ;

ELSIF Data ( 1 ) IN ' 1 '..' 1 ' THEN

IF Data ( 2 ) IN ' 0 '..' 0 ' THEN

Data ( 2 ) :=' 1 ';

ELSIF Data ( 2 ) IN ' 1 '..' 1 ' THEN

Data ( 2 ) :=' 2 ';

ELSIF Data ( 2 ) IN ' 2 '..' 2 ' THEN

Data ( 2 ) :=' 3 ';

ELSIF Data ( 2 ) IN ' 3 '..' 3 ' THEN

Data ( 2 ) :=' 4 ';

ELSIF Data ( 2 ) IN ' 4 '..' 4 ' THEN

Data ( 2 ) :=' 5 ';

ELSIF Data ( 2 ) IN ' 5 '..' 5 ' THEN

Data ( 2 ) :=' 6 ';

ELSIF Data ( 2 ) IN ' 6 '..' 6 ' THEN

Data ( 2 ) :=' 7 ';

ELSIF Data ( 2 ) IN ' 7 '..' 7 ' THEN

Data ( 2 ) :=' 8 ';

ELSIF Data ( 2 ) IN ' 8 '..' 8 ' THEN

Data ( 2 ) :=' 9 ';

ELSIF Data ( 2 ) IN ' 9 '..' 9 ' THEN

Data ( 1 ) :=' 2 ';

Data ( 2 ) :=' 0 ';

END IF ;

ELSIF Data ( 1 ) IN ' 2 '..' 2 ' THEN

IF Data ( 2 ) IN ' 0 '..' 0 ' THEN

Data ( 2 ) :=' 1 ';

ELSIF Data ( 2 ) IN ' 1 '..' 1 ' THEN

Data ( 2 ) :=' 2 ';

ELSIF Data ( 2 ) IN ' 2 '..' 2 ' THEN

Data ( 2 ) :=' 3 ';

ELSIF Data ( 2 ) IN ' 3 '..' 3 ' THEN

Data ( 2 ) :=' 4 ';

ELSIF Data ( 2 ) IN ' 4 '..' 4 ' THEN

Data ( 2 ) :=' 5 ';

ELSIF Data ( 2 ) IN ' 5 '..' 5 ' THEN

Data ( 2 ) :=' 6 ';

ELSIF Data ( 2 ) IN ' 6 '..' 6 ' THEN

Data ( 2 ) :=' 7 ';

ELSIF Data ( 2 ) IN ' 7 '..' 7 ' THEN

Data ( 2 ) :=' 8 ';

ELSIF Data ( 2 ) IN ' 8 '..' 8 ' THEN

Data ( 1 ) :=' 0 ';

Data ( 2 ) :=' 1 ';

Data ( 5 ) :=' 3 ';

END IF ;

END IF ;

WHEN OTHERS =>

NULL ;

END CASE ;

IF NOT Maly THEN

Put_Line ( Data ( 1 .. 10 ) ) ;

END IF ;

END PodajDate;

BEGIN

Put_Line ( "Podaj date, a dowiesz sie jaka bedzie jutro..." ) ;

Get_Line ( Data,Miejsce ) ;

IF MIEJSCE> 10 THEN

RAISE PODANO_ZBYT_DLUGI_LANCUCH_ZNAKOW;

ELSIF ( DATA ( 4 ) IN ' 0 '..' 0 ' AND ( DATA ( 5 ) IN ' 1 '..' 1 ' OR DATA ( 5 ) IN ' 3 '..' 3 ' OR DATA ( 5 ) IN ' 5 '..' 5 ' OR DATA ( 5 ) IN ' 7 '..' 7 ' OR DATA ( 5 ) IN ' 8 '..' 8 ' ) ) OR ( DATA ( 4 ) IN ' 1 '..' 1 ' AND ( DATA ( 5 ) IN ' 0 '..' 0 ' OR DATA ( 5 ) IN ' 2 '..' 2 ' ) ) THEN

IF ( ( DATA ( 1 ) IN ' 0 '..' 2 ' AND DATA ( 2 ) IN ' 0 '..' 9 ' ) OR ( DATA ( 1 ) IN ' 3 '..' 3 ' AND DATA ( 2 ) IN ' 0 '..' 1 ' ) ) AND ( DATA ( 3 ) IN '-'..'-' AND DATA ( 6 ) IN '-'..'-' ) THEN

IF DATA ( 7 ) IN ' 0 '..' 9 ' AND DATA ( 8 ) IN ' 0 '..' 9 ' AND DATA ( 9 ) IN ' 0 '..' 9 ' AND DATA ( 10 ) IN ' 0 '..' 9 ' THEN

Miesiac:= 1 ;

PodajDate;

ELSE

RAISE ZLY_FORMAT;

END IF ;

ELSE

RAISE ZLY_FORMAT;

END IF ;

ELSIF ( DATA ( 4 ) IN ' 0 '..' 0 ' AND ( DATA ( 5 ) IN ' 4 '..' 4 ' OR DATA ( 5 ) IN ' 6 '..' 6 ' OR DATA ( 5 ) IN ' 9 '..' 9 ' ) ) OR ( DATA ( 4 ) IN ' 1 '..' 1 ' AND DATA ( 5 ) IN ' 1 '..' 1 ' ) THEN

IF ( ( DATA ( 1 ) IN ' 0 '..' 2 ' AND DATA ( 2 ) IN ' 0 '..' 9 ' ) OR ( DATA ( 1 ) IN ' 3 '..' 3 ' AND DATA ( 2 ) IN ' 0 '..' 0 ' ) ) AND DATA ( 3 ) IN '-'..'-' AND DATA ( 6 ) IN '-'..'-' THEN

IF DATA ( 7 ) IN ' 0 '..' 9 ' AND DATA ( 8 ) IN ' 0 '..' 9 ' AND DATA ( 9 ) IN ' 0 '..' 9 ' AND DATA ( 10 ) IN ' 0 '..' 9 ' THEN

Miesiac:= 2 ;

PodajDate;

ELSE

RAISE ZLY_FORMAT;

END IF ;

ELSE

RAISE ZLY_FORMAT;

END IF ;

ELSIF DATA ( 4 ) IN ' 0 '..' 0 ' AND DATA ( 5 ) IN ' 2 '..' 2 ' THEN

IF DATA ( 7 ) IN ' 0 '..' 9 ' AND DATA ( 8 ) IN ' 0 '..' 9 ' AND DATA ( 9 ) IN ' 0 '..' 9 ' AND DATA ( 10 ) IN ' 0 '..' 9 ' THEN

IF Data ( 7 ) IN ' 1 '..' 9 ' AND Data ( 8 ) IN ' 0 '..' 0 ' AND Data ( 9 ) IN ' 0 '..' 0 ' AND Data ( 10 ) IN ' 0 '..' 0 ' THEN

Rok:= 1 ;

ELSIF DATA ( 9 ) IN ' 0 '..' 0 ' AND ( DATA ( 10 ) IN ' 4 '..' 4 ' OR DATA ( 10 ) IN ' 8 '..' 8 ' ) THEN

Rok:= 1 ;

ELSIF ( DATA ( 9 ) IN ' 2 '..' 2 ' OR DATA ( 9 ) IN ' 4 '..' 4 ' OR DATA ( 9 ) IN ' 6 '..' 6 ' OR DATA ( 9 ) IN ' 8 '..' 8 ' ) AND ( DATA ( 10 ) IN ' 0 '..' 0 ' OR DATA ( 10 ) IN ' 4 '..' 4 ' OR DATA ( 10 ) IN ' 8 '..' 8 ' ) THEN

Rok:= 1 ;

ELSIF DATA ( 9 ) IN ' 0 '..' 0 ' AND DATA ( 10 ) IN ' 0 '..' 0 ' AND DATA ( 8 ) NOT IN ' 1 '..' 9 ' THEN

Rok:= 1 ;

ELSIF ( DATA ( 9 ) IN ' 1 '..' 1 ' OR DATA ( 9 ) IN ' 3 '..' 3 ' OR DATA ( 9 ) IN ' 5 '..' 5 ' OR DATA ( 9 ) IN ' 7 '..' 7 ' OR DATA ( 9 ) IN ' 9 '..' 9 ' ) AND ( DATA ( 10 ) IN ' 2 '..' 2 ' OR DATA ( 10 ) IN ' 6 '..' 6 ' ) THEN

Rok:= 1 ;

END IF ;

IF ( DATA ( 1 ) IN ' 0 '..' 2 ' AND DATA ( 2 ) IN ' 0 '..' 9 ' ) AND DATA ( 3 ) IN '-'..'-' AND DATA ( 6 ) IN '-'..'-' THEN

IF Data ( 1 ) IN ' 2 '..' 2 ' AND Data ( 2 ) IN ' 0 '..' 9 ' AND Rok= 1 THEN

Miesiac:= 3 ;

PodajDate;

ELSIF Data ( 1 ) IN ' 2 '..' 2 ' AND Data ( 2 ) IN ' 0 '..' 8 ' AND Rok= 0 THEN

Miesiac:= 4 ;

PodajDate;

ELSE

RAISE ZLY_FORMAT;

END IF ;

ELSE

RAISE ZLY_FORMAT;

END IF ;

ELSE

RAISE ZLY_FORMAT;

END IF ;

ELSE

RAISE ZLY_FORMAT;

END IF ;

EXCEPTION

WHEN ZLY_FORMAT =>

Put_Line ( "Zly format daty..." ) ;

Kalendarz;

WHEN PODANO_ZBYT_DLUGI_LANCUCH_ZNAKOW =>

Put_Line ( "Zly format daty..." ) ;

Kalendarz;

WHEN OTHERS =>

Put_Line ( "Nieznany wyjatek" ) ;

Kalendarz;