unit Unit4;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm4 =
class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Button1: TButton;
procedure Edit1Change(Sender: TObject);
procedure Edit2Change(Sender: TObject);
procedure Edit3Change(Sender: TObject);
procedure Label2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form4: TForm4; Startguthaben, Endguthaben, Zinsen, monatlicherBetrag, Zinssatz, laufvariable: real;
a: Integer;
implementation
{$R *.dfm}
procedure TForm4.Edit1Change(Sender: TObject);
begin
startguthaben := StrToFloat(Edit1.Text);
end;
procedure TForm4.Edit2Change(Sender: TObject);
begin
zinssatz := StrToFloat(Edit2.Text);
end;
procedure TForm4.Edit3Change(Sender: TObject);
begin
monatlicherBetrag := StrToFloat(Edit3.Text);
end;
procedure TForm4.Button1Click(Sender: TObject);
begin
Zinsen := 0;
For a :=1
to 12
do begin;
Startguthaben := Startguthaben + monatlicherBetrag;
Zinsen := 1/12*Startguthaben/100*Zinssatz;
Endguthaben := Zinsen + startguthaben;
end;
Label2.Caption := FloatToStr(Endguthaben);
Label1.Caption := FloatToStr(Zinsen);
end;
end.