unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, Grids, ExtCtrls;
type
TForm1 =
class(TForm)
BitBtn1: TBitBtn;
GroupBox1: TGroupBox;
EdSparbetrag: TEdit;
EdFestzins: TEdit;
EdMindestlaufzeit: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
procedure BitBtn1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.BitBtn1Click(Sender: TObject);
var i,Mindestlaufzeit:Integer;
Festzins,Zinsen,Ende,Anfang:Real;
begin
Anfang:=StrToFloat(EdSparbetrag.Text);
Festzins:=StrToFloat(EdFestzins.Text)/100;
Mindestlaufzeit:=StrToInt(EdMindestlaufzeit.Text);
StringGrid1.RowCount:=Mindestlaufzeit+1;
for i:=1
to Mindestlaufzeit
do
with StringGrid1
do
begin
Cells[0,i]:=IntToStr(i);
Cells[1,i]:=FloatToStrF(Anfang,ffFixed,10,3);
Zinsen:=Anfang*Festzins;
Cells[2,i]:=FloatToStrF(Zinsen,ffFixed,10,3);
Ende:=Anfang+Zinsen;
Cells[3,i]:=FloatToStrF(Ende,ffFixed,10,3);
Anfang:=Ende;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
with StringGrid1
do
begin
Cells[0,0]:='
Jahr';
Cells[1,0]:='
Anfang';
Cells[2,0]:='
Zinsen';
Cells[3,0]:='
Ende';
end;
end;
procedure Einspeichern;
begin
end;
end.