0% found this document useful (0 votes)
250 views

Design Form Seperti Berikut: Coding

The document describes a Delphi form application that performs arithmetic operations and logical comparisons on integer and boolean values entered in edit boxes. The form contains edit boxes and buttons to add, subtract, multiply, divide, and perform other operations on the integer values. It also contains buttons to check for equality, less than, greater than and other logical comparisons between the integer values. Additional buttons perform logical AND, OR and NOT operations on boolean values entered in the edit boxes.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
250 views

Design Form Seperti Berikut: Coding

The document describes a Delphi form application that performs arithmetic operations and logical comparisons on integer and boolean values entered in edit boxes. The form contains edit boxes and buttons to add, subtract, multiply, divide, and perform other operations on the integer values. It also contains buttons to check for equality, less than, greater than and other logical comparisons between the integer values. Additional buttons perform logical AND, OR and NOT operations on boolean values entered in the edit boxes.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Delphi Manajemen Informatika (Variable,Operator & Type Data) + (If dengan 1 Kondisi) Lab F Sore Design Form Seperti

Berikut : Coding : implementation {$R *.dfm} var n1,n2:integer; hasil,nilai1,nilai2 :boolean; procedure TForm3.e1Click(Sender: TObject); begin n1:=strtoint(en1.Text); n2:=strtoint(en2.Text); ehasil.Text:=inttostr(n1+n2); end; procedure TForm3.Button2Click(Sender: TObject); begin n1:=strtoint(en1.Text); n2:=strtoint(en2.Text); ehasil.Text:=floattostr(n1-n2); end; procedure TForm3.e2Click(Sender: TObject); begin n1:=strtoint(en1.Text); n2:=strtoint(en2.Text); ehasil.Text:=floattostr(n1*n2); end;

3 Buah EditBox Button

By. DCP Resty Ijay - Kiki

Page 1

Delphi Manajemen Informatika (Variable,Operator & Type Data) + (If dengan 1 Kondisi) Lab F Sore procedure TForm3.Button4Click(Sender: TObject); begin n1:=strtoint(en1.Text); n2:=strtoint(en2.Text); ehasil.Text:=floattostr(n1/n2); end; procedure TForm3.Button5Click(Sender: TObject); begin n1:=strtoint(en1.Text); n2:=strtoint(en2.Text); ehasil.Text:=floattostr(n1 div n2); end; procedure TForm3.Button6Click(Sender: TObject); begin n1:=strtoint(en1.Text); n2:=strtoint(en2.Text); ehasil.Text:=floattostr(n1 mod n2); end; procedure TForm3.Button7Click(Sender: TObject); begin n1:=strtoint(en1.Text); n2:=strtoint(en2.Text); hasil:=n1=n2; if hasil=true then ehasil.Text:='True' else ehasil.Text:='False'; end; procedure TForm3.Button8Click(Sender: TObject); begin n1:=strtoint(en1.Text); n2:=strtoint(en2.Text); hasil:=n1<n2; if hasil=true then ehasil.Text:='True' else ehasil.Text:='False'; end; procedure TForm3.Button9Click(Sender: TObject); begin n1:=strtoint(en1.Text); n2:=strtoint(en2.Text); hasil:=n1>n2; if hasil=true then ehasil.Text:='True' else ehasil.Text:='False'; end; procedure TForm3.Button10Click(Sender: TObject); begin n1:=strtoint(en1.Text); n2:=strtoint(en2.Text); hasil:=n1<=n2; if hasil=true then ehasil.Text:='True' else ehasil.Text:='False'; end; Page 2

By. DCP Resty Ijay - Kiki

Delphi Manajemen Informatika (Variable,Operator & Type Data) + (If dengan 1 Kondisi) Lab F Sore procedure TForm3.Button11Click(Sender: TObject); begin n1:=strtoint(en1.Text); n2:=strtoint(en2.Text); hasil:=n1>=n2; if hasil=true then ehasil.Text:='True' else ehasil.Text:='False'; end; procedure TForm3.Button12Click(Sender: TObject); begin n1:=strtoint(en1.Text); n2:=strtoint(en2.Text); hasil:=n1<>n2; if hasil=true then ehasil.Text:='True' else ehasil.Text:='False'; end; procedure TForm3.Button13Click(Sender: TObject); begin nilai1:=strtobool(en1.Text); nilai2:=strtobool(en2.Text); hasil:=nilai1 And nilai2; if hasil=true then ehasil.Text:='True' else ehasil.Text:='False'; end; By. DCP Resty Ijay - Kiki procedure TForm3.Button15Click(Sender: TObject); begin nilai1:=strtobool(en1.Text); nilai2:=strtobool(en2.Text); hasil:=nilai1 or nilai2; if hasil=true then ehasil.Text:='True' else ehasil.Text:='False'; end; procedure TForm3.Button17Click(Sender: TObject); begin nilai1:=strtobool(en1.Text); hasil:=not nilai1; if hasil=true then ehasil.Text:='True' else ehasil.Text:='False'; end; procedure TForm3.Button14Click(Sender: TObject); begin close; end;

Page 3

You might also like