memo1.Lines.Add(edit1.text);
edit1.text := '0';
edit1.setfocus;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
i,j,jml : integer;
rata : real;
begin
jml:=0;
j := memo1.lines.count;
for i := 0 to j-1 do
jml := jml + strtoint (memo1.lines[i]);
rata := jml/j;
edit2.Text:= floattostr (rata);
end;
end.
edit1.text := '0';
edit1.setfocus;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
i,j,jml : integer;
rata : real;
begin
jml:=0;
j := memo1.lines.count;
for i := 0 to j-1 do
jml := jml + strtoint (memo1.lines[i]);
rata := jml/j;
edit2.Text:= floattostr (rata);
end;
end.
0 komentar:
Posting Komentar