unit praemu;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    AlterEin: TEdit;
    DjEin: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Praemie: TEdit;
    Label3: TLabel;
    PBerechnung: TButton;
    procedure PBerechnungClick(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.PBerechnungClick(Sender: TObject);
var alter, dienst, praem : integer;
begin
  alter  := strtoint(AlterEin.text);
  dienst := strtoint(DjEin.text);
  praem := 0;
  if dienst >= 6
  then
    begin
      praem := 80 + 20*dienst;
      if alter > 50 then praem := praem + 50;
    end
  else
    if dienst >1 then praem := 200;
  Praemie.Text := inttostr(praem);

end;

end.
