........ALJABAR HIMPUNAN..........
LISTBOX1=INPUT DATA A, LISTBOX2=AnB,
LISTBOX3=AUB, LISTBOX4=A+B, LISTBOX5=A-B
LISBOX6=INPUTB
procedure TForm1.Button8Click(Sender: TObject); //SELESAI
begin
close;
end;
procedure TForm1.Button7Click(Sender: TObject); //HAPUS
begin
edit1.Clear; edit2.Clear;
listbox1.Clear; listbox2.Clear; listbox3.Clear; listbox4.Clear;
listbox5.Clear; listbox6.Clear;
end;
procedure TForm1.Button1Click(Sender: TObject); //>>
begin
with ListBox1.Items do
Add(Edit1.Text);
Edit1.Text:='';
end;
procedure TForm1.Button6Click(Sender: TObject); //<<
begin
with ListBox6.Items do
Add(Edit2.Text);
Edit2.Text:='';
end;
procedure TForm1.Button2Click(Sender: TObject);//AnB
Var i,j:Integer;
A,B:Array[0..10] of String;
begin
For i:=0 to ListBox1.Items.Count-1 do
A[i]:=ListBox1.Items[i];
For j:=0 to ListBox6.Items.Count-1 do
B[j]:=ListBox6.Items[j];
For i:=0 to ListBox1.Items.Count-1 do
begin
For j:=0 to ListBox6.Items.Count-1 do
if A[i]=B[j] then ListBox2.Items.Add(A[i]);
end;
end;
procedure TForm1.Button3Click(Sender: TObject); //AUB
Var i,j:Integer;
A,B:Array[0..100] of String;
ada:Boolean;
begin
For i:=0 to ListBox1.Items.Count-1 do
A[i]:=ListBox1.Items[i];
For j:=0 to ListBox6.Items.Count-1 do
B[j]:=ListBox6.Items[j];
For i:=0 to ListBox1.Items.Count-1 do
ListBox3.Items.Add(A[i]);
For j:=0 to ListBox6.Items.Count-1 do
begin
ada:=false;
For i:=0 to ListBox1.Items.Count-1 do
if A[i]=B[j] then ada:=true;
if ada=false then ListBox3.Items.Add(B[j]);
end;
end;
procedure TForm1.Button4Click(Sender: TObject); //A+B
Var i,j:Integer;
A,B:Array[0..100] of String;
ada:Boolean;
begin
For i:=0 to ListBox1.Items.Count-1 do
A[i]:=ListBox1.Items[i];
For j:=0 to ListBox6.Items.Count-1 do
B[j]:=ListBox6.Items[j];
For i:=0 to ListBox1.Items.Count-1 do
begin
ada:=false;
For j:=0 to ListBox6.Items.Count-1 do
if A[i]=B[j] then ada:=true;
if ada=false then ListBox4.Items.Add(A[i]);
end;
For j:=0 to ListBox6.Items.Count-1 do
begin
ada:=false;
For i:=0 to ListBox1.Items.Count-1 do
if A[i]=B[j] then ada:=true;
if ada=false then ListBox4.Items.Add(B[j]);
end;
end;
procedure TForm1.Button5Click(Sender: TObject); //A-B
Var i,j:Integer;
A,B:Array[0..100] of String;
ada:Boolean;
begin
For i:=0 to ListBox1.Items.Count-1 do
A[i]:=ListBox1.Items[i];
For j:=0 to ListBox6.Items.Count-1 do
B[j]:=ListBox6.Items[j];
For i:=0 to ListBox1.Items.Count-1 do
begin
ada:=false;
For j:=0 to ListBox6.Items.Count-1 do
if A[i]=B[j] then ada:=true;
if ada=false then ListBox5.Items.Add(A[i]);
end;
end;
end.
Source : http://galihroni.blogspot.com/2011/01/aljabar-himpunan.html
LISTBOX1=INPUT DATA A, LISTBOX2=AnB,
LISTBOX3=AUB, LISTBOX4=A+B, LISTBOX5=A-B
LISBOX6=INPUTB
procedure TForm1.Button8Click(Sender: TObject); //SELESAI
begin
close;
end;
procedure TForm1.Button7Click(Sender: TObject); //HAPUS
begin
edit1.Clear; edit2.Clear;
listbox1.Clear; listbox2.Clear; listbox3.Clear; listbox4.Clear;
listbox5.Clear; listbox6.Clear;
end;
procedure TForm1.Button1Click(Sender: TObject); //>>
begin
with ListBox1.Items do
Add(Edit1.Text);
Edit1.Text:='';
end;
procedure TForm1.Button6Click(Sender: TObject); //<<
begin
with ListBox6.Items do
Add(Edit2.Text);
Edit2.Text:='';
end;
procedure TForm1.Button2Click(Sender: TObject);//AnB
Var i,j:Integer;
A,B:Array[0..10] of String;
begin
For i:=0 to ListBox1.Items.Count-1 do
A[i]:=ListBox1.Items[i];
For j:=0 to ListBox6.Items.Count-1 do
B[j]:=ListBox6.Items[j];
For i:=0 to ListBox1.Items.Count-1 do
begin
For j:=0 to ListBox6.Items.Count-1 do
if A[i]=B[j] then ListBox2.Items.Add(A[i]);
end;
end;
procedure TForm1.Button3Click(Sender: TObject); //AUB
Var i,j:Integer;
A,B:Array[0..100] of String;
ada:Boolean;
begin
For i:=0 to ListBox1.Items.Count-1 do
A[i]:=ListBox1.Items[i];
For j:=0 to ListBox6.Items.Count-1 do
B[j]:=ListBox6.Items[j];
For i:=0 to ListBox1.Items.Count-1 do
ListBox3.Items.Add(A[i]);
For j:=0 to ListBox6.Items.Count-1 do
begin
ada:=false;
For i:=0 to ListBox1.Items.Count-1 do
if A[i]=B[j] then ada:=true;
if ada=false then ListBox3.Items.Add(B[j]);
end;
end;
procedure TForm1.Button4Click(Sender: TObject); //A+B
Var i,j:Integer;
A,B:Array[0..100] of String;
ada:Boolean;
begin
For i:=0 to ListBox1.Items.Count-1 do
A[i]:=ListBox1.Items[i];
For j:=0 to ListBox6.Items.Count-1 do
B[j]:=ListBox6.Items[j];
For i:=0 to ListBox1.Items.Count-1 do
begin
ada:=false;
For j:=0 to ListBox6.Items.Count-1 do
if A[i]=B[j] then ada:=true;
if ada=false then ListBox4.Items.Add(A[i]);
end;
For j:=0 to ListBox6.Items.Count-1 do
begin
ada:=false;
For i:=0 to ListBox1.Items.Count-1 do
if A[i]=B[j] then ada:=true;
if ada=false then ListBox4.Items.Add(B[j]);
end;
end;
procedure TForm1.Button5Click(Sender: TObject); //A-B
Var i,j:Integer;
A,B:Array[0..100] of String;
ada:Boolean;
begin
For i:=0 to ListBox1.Items.Count-1 do
A[i]:=ListBox1.Items[i];
For j:=0 to ListBox6.Items.Count-1 do
B[j]:=ListBox6.Items[j];
For i:=0 to ListBox1.Items.Count-1 do
begin
ada:=false;
For j:=0 to ListBox6.Items.Count-1 do
if A[i]=B[j] then ada:=true;
if ada=false then ListBox5.Items.Add(A[i]);
end;
end;
end.
Source : http://galihroni.blogspot.com/2011/01/aljabar-himpunan.html
0 Response to "PROJECT ALJABAR HIMPUNAN (DELPHI 2010)"
Post a Comment