unit uTaxi;

interface

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

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    Label2: TLabel;
    Edit2: TEdit;
    Label3: TLabel;
    Button1: TButton;
    Button2: TButton;
    Label4: TLabel;
    Label5: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var kmgeld, koffergeld, gesamtgeld : real;
    zeile1, zeile2, zeile3, zeile4 : string;
begin
  { Verarbeitung }
  kmgeld := strtofloat(edit1.text)*0.60;
  koffergeld := strtofloat(edit2.text)*1;
  gesamtgeld := 4 + kmgeld + koffergeld;

  {Ausgabe - Formatierung}
  zeile1 :='Grundgebühr:   '+format('%8.2f',[4.0])+' Euro';
  zeile2 :='Kilometergeld: '+format('%8.2f',[kmgeld])+' Euro';
  zeile3 :='Koffergeld:    '+format('%8.2f',[koffergeld])+' Euro';
  zeile4 :='Insgesamt:     '+format('%8.2f',[gesamtgeld])+' euro';

  {Ausgabe}
  label5.caption :=zeile1+#13+zeile2+#13+zeile3+#13+zeile4;

end;

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

end.
