Untuk kali ini saya membuat project yang sederhana mengenai Study Matematika Diskrit yaitu tentang tabel kebenaran. tabel kebenaran ini saya buat melalu Aplikasi Delphi 2007. didala tabel kebenaran yang saya buat ini ada konjungsi, disjungsi, kontradiksi, dan tautologi, silahkan dipeljari. semoga sepenggal script ini bisa bermanfaat bagi kita semua. alangkah indah untuk berbagi. ;)
unit Unit1;
interface
uses
Windows, Messages,
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids,
StdCtrls;
type
TForm1 =
class(TForm)
Button1: TButton ;
Grid1:
TStringGrid;
Button2: TButton;
Button3: TButton;
Button4: TButton;
procedure
FormCreate(Sender: TObject);
procedure
Button1Click(Sender: TObject);
procedure
Button2Click(Sender: TObject);
procedure
Button3Click(Sender: TObject);
procedure
Button4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public
declarations }
end;
var
Form1: TForm1;
i,j : integer;
P,Q : array [0..
100] of string;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
for i := 1 to grid1.RowCount -1 do
begin
if (p[i] ='T') and
(Q[i]='T') then
grid1.cells[2,i]:='T'
else
grid1.Cells [2,i]:='F';
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
for i := 1 to grid1.RowCount -1 do
begin
if (p[i] ='F') and
(Q[i]='F') then
grid1.cells[3,i]:='F'
else
grid1.Cells [3,i]:='T';
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
for i := 1 to grid1.RowCount -1 do
begin
if (p[i] ='T') and
(Q[i]='T') then
grid1.cells[4,i]:='T'
else
grid1.Cells [4,i]:='T';
end;
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
for i := 1 to grid1.RowCount -1 do
begin
if (p[i] ='F') and
(Q[i]='F') then
grid1.cells[5,i]:='F'
else
grid1.Cells [5,i]:='F';
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
with grid1 do
begin
rowcount :=5;
ColCount :=7;
cells[0,0]:='p';
cells[1,0]:='q';
cells[2,0]:='p ^ q';
cells[3,0]:='p v q';
cells[4,0]:='p v ~(p
n q)';
cells[5,0]:='(p n q)
^ ~ (p v q)';
cells[0,1]:='T';
cells[0,2]:='T';
cells[0,3]:='F';
cells[0,4]:='F';
cells[1,1]:='T';
cells[1,2]:='F';
cells[1,3]:='T';
cells[1,4]:='F';
end;
for i := 1 to grid1.rowcount - 1 do
p[i]:= grid1.cells[0,i];
for j := 1 to grid1.RowCount - 1 do
Q[j]:=grid1.Cells [1,j];
end;
end.
admin saya bisa minta bantu, untuk di C++ apa ada source kodenya? jika ada saya boleh minta kiim ke skahfi77@gmail.com , terima kasih
admin bisa bantu cara menambahkan kolom kesampingnya ga???terima kasih