Zestaw 2
Zadanie 1
procedure TForm1.Button1Click(Sender: TObject);
var i,n:integer;
suma:real;
begin
n:=StrToIntDef(Edit1.Text,1);
Edit1.Text:=IntToStr(n);
for i := 1 to n do suma:=suma+(1)/(i*i);
Label3.Caption:=FloatToStrF(suma,ffNumber,4,2);
end;
end.
Zadanie 2
procedure TForm1.FormShow(Sender: TObject);
var n: integer;
Sn,Sn2: double;
f:textFile;
begin
n:=20;
AssignFile(f,'C:\Rezultaty\wyniki.txt');
Rewrite(f);
repeat
Sn := (1)/(n*n) ;
Sn2 :=Abs( n - Sqr((PI/4)));
Writeln(f,IntToStr(n) + ' ' + FloatToStr(Sn)+ ' ' + FloatToStr(Sn2));
n := n+20;
until n > 2000;
CloseFile(f);
end;
end.
Zadanie 3
Zadanie 4
Zadanie 5
Zadanie 6
procedure TForm1.FormResize(Sender: TObject);
begin
Canvas.Brush.Color := clWhite;
Canvas.Brush.Style := bsSolid;
Canvas.Pen.Color := clRed; //kolor
Canvas.Brush.Style:=bsCross;
Canvas.Brush.Color := clNavy;
Canvas.ellipse(50,5,250,200);
end;