unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
Stueckzahl: TLabel;
Einzelpreis: TLabel;
Grundpreis: TLabel;
Rabattsatz: TLabel;
Rabatt: TLabel;
Endpreis: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
RadioGroup1: TRadioGroup;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
//Stueckzahl
a: integer;
//Einzelpreis
b: integer;
//Grundpreis
c: integer;
//Rabattsatz
d: integer;
//Rabatt
e:integer;
//Endpreis
f: integer;
implementation
{$R *.dfm}
procedure TForm1.Button3Click(Sender: TObject);
begin
close;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
edit1.Clear;
edit2.Clear;
edit3.Clear;
edit4.Clear;
edit5.Clear;
edit6.Clear;
RadioGroup1.itemindex:=-1;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
//Errechnung des Grundpreises
a:=strtoint(Edit1.text);
b:=strtoint(Edit2.text);
c:=a*b;
edit3.text:=inttostr(c);
//Bestimmung des Rabattsatzes
//Neukunde
if (RadioGroup1.ItemIndex=0)
and (a>=0)
and (a<=99)
then
begin
d:=5;
edit4.text:=inttostr(d);
end
end;
end.