unit Keskiarco;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
uusiluku: TEdit;
vastaus: TEdit;
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
a:integer;
summa:real;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var luku:real;
begin
luku:=strtofloat(uusiluku.text);
uusiluku.text:=' ';
a:=a+1;
summa:=summa+luku;
vastaus.text:='keskiarco on:'+floattostr(summa/a);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
a:=0;
summa:=0;
end;
end.
a:=strtofloat(luku1.text);
b:=strtofloat(luku2.text);
vastaus.text:=floattostr(a)+'*'+floattostr(b)+'='+floattostr(a*b);
a:=strtofloat(luku1.text);
b:=strtofloat(luku2.text);
vastaus.text:=floattostr(a)+':'+floattostr(b)+'='+floattostr((a/b));
unit laskuri;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
a:integer;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
a:=a+10;
canvas.rectangle(300+a,200,400+a,300);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
a:=0;
end;
end.