Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Unit1;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls;
- type
- TForm1 = class(TForm)
- Edit1: TEdit;
- Edit2: TEdit;
- Edit3: TEdit;
- Label1: TLabel;
- Button1: TButton;
- Button2: TButton;
- Button3: TButton;
- Button4: TButton;
- Button5: TButton;
- Button6: TButton;
- procedure Button1Click(Sender: TObject);
- procedure Button6Click(Sender: TObject);
- procedure Button3Click(Sender: TObject);
- private
- { Private-Deklarationen }
- public
- { Public-Deklarationen }
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.dfm}
- var a,b:real;
- i:integer;
- function Summe(x,y:real):real;
- begin
- Summe:=x+y;
- end;
- function Potenz(x,y:longint):longint;
- var z,i:longint;
- begin
- z:=x;
- for i:=1to y-1 do
- z:=z*x;
- Potenz:=z;
- end;
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- a:=Strtofloat(edit1.Text);
- b:=strtofloat(edit3.text);
- edit2.text:=FloatToStr(Summe(a,b));
- end;
- procedure TForm1.Button6Click(Sender: TObject);
- begin
- form1.close;
- end;
- procedure TForm1.Button3Click(Sender: TObject);
- begin
- a:=Strtofloat(edit1.Text);
- b:=Strtofloat(edit3.text);
- edit2.text:=FloatToStr(Potenz(a,b));
- end;
- end.
Add Comment
Please, Sign In to add comment