unit uTR1;

interface

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

type
  TForm1 = class(TForm)
    XEin: TEdit;
    YEin: TEdit;
    ErgebnisAus: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Summe: TButton;
    Differenz: TButton;
    Produkt: TButton;
    Quotient: TButton;
    Kehrwert: TButton;
    Ende: TButton;
    procedure SummeClick(Sender: TObject);
    procedure DifferenzClick(Sender: TObject);
    procedure ProduktClick(Sender: TObject);
    procedure QuotientClick(Sender: TObject);
    procedure EndeClick(Sender: TObject);
    procedure KehrwertClick(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.SummeClick(Sender: TObject);
var x, y, c : real;
begin
  x := strtofloat(XEin.text);
  y := strtofloat(YEin.text);
  c := x + y;
  ErgebnisAus.Text := floattostr(c);
end;

procedure TForm1.DifferenzClick(Sender: TObject);
var x, y, c : real;
begin
  x := strtofloat(XEin.text);
  y := strtofloat(YEin.text);
  c := x - y;
  ErgebnisAus.Text := floattostr(c);
end;

procedure TForm1.ProduktClick(Sender: TObject);
var x, y, c :real;
begin
  x := strtofloat(XEin.text);
  y := strtofloat(YEin.text);
  c := x * y;
  ErgebnisAus.Text := floattostr(c);
end;

procedure TForm1.QuotientClick(Sender: TObject);
var x, y, c :real;
begin
  x := strtofloat(XEin.text);
  y := strtofloat(YEin.text);
  c := x / y;
  ErgebnisAus.Text := floattostr(c);
end;

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

procedure TForm1.KehrwertClick(Sender: TObject);
var x, c :real;
begin
   x := strtofloat(XEin.text);
   c := 1/x;
   ErgebnisAus.Text := floattostr(c);
end;

end.
