Kamis, 23 April 2015

Login, Penjumlahan, Pengurangan, Perkalian, Pembagian Menggunakan Delphi 7









 






A.    Cara Menjalankan Program
1.      Masukkan Username: WIDY dan Password: 1400019050 untuk login.
2.      Pilih rumus perhitungan ( penjumlahan, pengurangan, perkalian, atau pembagian)
3.      Masukan angka pertama dan kedua
4.      Secara otomatis komputer akan menampilakan nilai yang diminta.




B.   SOURCE KODE


unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Buttons, StdCtrls, jpeg, ExtCtrls;

type
  TForm1 = class(TForm)
    Image1: TImage;
    GroupBox1: TGroupBox;
    Image2: TImage;
    Label1: TLabel;
    Edit1: TEdit;
    Label2: TLabel;
    Edit2: TEdit;
    Button1: TButton;
    BitBtn1: TBitBtn;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses Unit2;

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var username,password:string;
begin
username:=string(edit1.TEXT);
password:=string(edit2.TEXT);
if(username='WIDY')and(password='1400019050')then
begin
showmessage('TRUE');
FORM2.show;
form1.Visible:=false;
end
ELSE SHOWMESSAGE('WRONG')
end;


end.


unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Buttons, StdCtrls, ExtCtrls, jpeg;

type
  TForm2 = class(TForm)
    Image1: TImage;
    Panel1: TPanel;
    Panel2: TPanel;
    Label1: TLabel;
    Edit1: TEdit;
    Panel3: TPanel;
    Edit2: TEdit;
    Label2: TLabel;
    RadioGroup1: TRadioGroup;
    Panel4: TPanel;
    Button1: TButton;
    BitBtn1: TBitBtn;
    procedure Panel4Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
  function hitung_penjumlahan:string;
  function hitung_pengurangan:string;
  function hitung_perkalian:string;
  function hitung_pembagian:string;
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}
function tform2.hitung_penjumlahan:string;
var A,B,C:real;
begin
A:=strtoint(edit1.Text);
B:=strtoint(edit2.Text);
C:=A+B;
label2.Caption:=floattostr(C);
panel3.Caption:='+';
end;

function tform2.hitung_pengurangan:string;
var D,E,F:real;
begin
D:=strtoint(edit1.Text);
E:=strtoint(edit2.Text);
F:=D-E;
label2.Caption:=floattostr(F);
panel3.Caption:='-';
end;

function tform2.hitung_perkalian:string;
var G,H,I:real;
begin
G:=strtoint(edit1.Text);
H:=strtoint(edit2.Text);
I:=G*H;
label2.Caption:=floattostr(I);
panel3.Caption:='X';
end;

function tform2.hitung_pembagian:string;
var J,K,L:real;
begin
J:=strtoint(edit1.Text);
K:=strtoint(edit2.Text);
L:=J/K;
label2.Caption:=floattostr(L);
panel3.Caption:=':';
end;


procedure TForm2.Panel4Click(Sender: TObject);
begin
case
radiogroup1.ItemIndex of
0:hitung_penjumlahan;
end;
case
radiogroup1.ItemIndex of
1:hitung_pengurangan;
end;
case
radiogroup1.ItemIndex of
2:hitung_perkalian;
end;
case
radiogroup1.ItemIndex of
3:hitung_pembagian;
end;

end;

procedure TForm2.Button1Click(Sender: TObject);
begin
edit1.Clear;
edit2.Clear;

end;

end.



yup, itu program sederhana ku, semoga membantu ya. Assallamualaikum^-^
free copy source kode
free share
thanks