rendered paste bodyunit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
L_Praemienrechner: TLabel;
L_Jahre: TLabel;
L_Alter: TLabel;
L_Praemien_in_Euro: TLabel;
E_Jahre: TEdit;
E_Alter: TEdit;
L_Ergebnis: TLabel;
B_Berechnen: TButton;
procedure B_BerechnenClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.B_BerechnenClick(Sender: TObject);
var Zahl1, Zahl2, Ergebnis:Real;
begin
Zahl1 := StrToFloat(E_Jahre.Text);
Zahl2 := StrToFloat(E_Alter.Text);
L_Ergebnis.Caption := FloatToStr(Ergebnis);
end;
begin
if Zahl1 = 0 then
begin
L_Ergebnis.Caption:='keine Prämie';
end
else
if Jahre<=5 then
begin
Ergebnis.Caption := 50
end
end.