var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.BitBtn2Click(Sender: TObject);
var
sName , sYearOfBirth , sCurrentYear : string;
iCurrent , iBirth , iAge, iKids, iJuniors, iBigKids, iTeens, iSeniors, iCurrentAge : integer;
begin
sName := Edit1.Text ;
sYearOfBirth := Edit2.Text;
sCurrentYear := Edit3.Text ;
iBirth := StrToInt(sYearOfBirth);
iCurrent := StrToInt(sCurrentYear) ;
iCurrentAge := (iCurrent - iBirth);
RichEdit1.Lines.Add( ' Name of entrant is:' + sName) ;
RichEdit1.Lines.Add( ' Your age this year is ' + IntToStr(iCurrentAge) ) ;
case iAge of
3..5 : Inc(iKids);
6..8 : Inc(iJuniors);
9..10 : Inc(iBigKids);
13..16 : Inc(iTeens);
17..18 : Inc(iSeniors);
if iAge = iCurrentAge
then RichEdit1.Lines.Add(' You are eligble to enter this section ')
end;
end;
end.