unit uSparen;

interface

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

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Aguth: TEdit;
    guth1: TEdit;
    guth2: TEdit;
    guth3: TEdit;
    Berechne: TButton;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    Zinssatz: TEdit;
    Label10: TLabel;
    Ende: TButton;
    procedure BerechneClick(Sender: TObject);
    procedure EndeClick(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.BerechneClick(Sender: TObject);
var zfaktor, ahaben, haben1, haben2, haben3 : real;
begin
  zfaktor := 1 + strtofloat(Zinssatz.text)/100;
  ahaben := strtofloat(Aguth.text);
  haben1 := ahaben * zfaktor;
  haben2 := haben1 * zfaktor;
  haben3 := haben2 * zfaktor;
  guth1.text := floattostr(haben1);
  guth2.text := floattostr(haben2);
  guth3.text := floattostr(haben3);
end;

procedure TForm1.EndeClick(Sender: TObject);
begin
  close;
end;

end.
