Selasa, 10 September 2013





NO


TOOLBOX

PROPERTIES

1.
Label1
Caption  : Berat (Kg)
Name     : Label1
2.
Label2
Caption  : Kosongkan
Name     : Label1
3.
Edit1
Name     : Edit1
Text        : 0
4.
Command1
Caption  : Hitung
Name     : Command1
5.
Command2
Caption  : Keluar
Name     : Command2
6.
ComboBox
Items      : Jeruk
                  Mangga
                  Durian
                  Pepaya
                  Anggur
                  Apel
Name     : ComboBox1
 


Listing Program :
procedure TForm1.Button1Click(Sender: TObject);
var
  berat, harga, pembayaran : integer;
  jenis : integer;
begin
   // ubah string ke integer
   berat := StrtoInt (edit1.Text);
   // ambil jenis buah yang diambil
   jenis := comboBox1.ItemIndex;
   case jenis of
                0 : harga := 5000;
                 1 : harga := 15000;
                2 : harga := 20000;
                3 : harga := 25000;
                4 : harga := 30000;
                5 : harga := 35000;
end;
 Pembayaran:= berat * harga;
// tampil di label2
  label2.Caption := IntToStr(Pembayaran);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;

Senin, 09 September 2013

Cara Membuat Kalkulator Menggunakan Program Delphi 7.0
From : http://www.atiefprogramer.blogspot.com






NO

TOOLBOX


PROPERTIES
1.
Label1

Caption  : Nama Judul
Name     : Label 1
2.

Label2
Caption  : Data 1
Name     : Label 2
3.
Label3
Caption  : Data 2
Name     : Label 3
4.
Edit1
Text       : Dikosongkan
Name     : EdData1
5.
Edit2
Text       : Dikosongkan
Name     : EdData2
6.
Edit3
Text       : Dikosongkan
Name     : EdData3
7.

Button1
Caption  : Kali
Name     : BtnKali
8.

Button2
Caption  : Bagi
Name     : BtnBagi
9.

Button3
Caption  : Tambah
Name     : BtnTambah
10.

Button4
Caption  : Kurang
Name     : BtnKurang
11.
Button5

Caption  : Keluar
Name     : BtnKeluar


Listing Program:

procedure TForm1.btnKaliClick(Sender: TObject);
begin EdHasil.Text:=FloatTostr(strToFloat(EdData1.Text)*strToFloat(EdData2.Text));
end;

procedure TForm1.btnBagiClick(Sender: TObject);
begin
EdHasil.Text:=FloatTostr(strToFloat(EdData1.Text)/strToFloat(EdData2.Text));
end;

procedure TForm1.btnTambahClick(Sender: TObject);
begin
EdHasil.Text:=FloatTostr(strToFloat(EdData1.Text)+strToFloat(EdData2.Text));
end;

procedure TForm1.btnKurangClick(Sender: TObject);
begin
EdHasil.Text:=FloatTostr(strToFloat(EdData1.Text)-strToFloat(EdData2.Text));
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;

end.

Semoga Program Kalkulator ini bisa bermanfaat untuk kalian semua Amin.....!!!
Ingat Sebelum Mencobanya baca Bismillah ya...!!!

Free Music Online
Free Music Online

free music at divine-music.info

Blogroll

Blogger templates