Klik To Become Our Ads

Protected by Copyscape Online Plagiarism Checker

Minggu, 24 Juli 2011

MEMBUAT PROGRAM MENGKONVERSI SUHU DGN VB

Sekedar Sharing Aj
http://www.mediafire.com/?aaxw3fvcer8moi9

tuh Download Aj Program gw tentang Konversi Suhu Yang Sudah Jadi Gan!

ato yg ini Aj yg Lebih Simple;

1.    Buatlah New Project pada software VB anda kemudian tambahkan dua buah kontrol frame, enam kontrol OptionButton, dua kontrol TextBox dan satu kontrol commandButton pada form, kemudian atur letaknya seperti pada gambar berikut :
GAMBAR PROGRAM KONVERSI SUHU
2.    Ubah properti masing-masing kontrol dengan ketentuan sebagai berikut :
Kontrol Properti Setting
Frame1 Caption Pilih Data Input
Option1 Caption Celcius
Option2 Caption reamur
Option3 Caption Farenheit
TextBox1 Text Kosongkan
Frame2 Caption Pilih Data output
Option4 Caption Celcius
Option5 Caption reamur
Option6 Caption Farenheit
TextBox2 Text Kosongkan
Command1 Caption Selesai
3.    Aktifkan jendela kode, dengan cara klik menu view, pilih code. Buat prosedur rumus dengan cara ketikkan sub rumus konversi dan akhiri dengan enter.
4.    Di dalam prosedur Sub Rumus, berikan perintah untuk masing-masing Opt sebagai berikut :
Private Sub rumus ()
If Option1.Value = True And Option4.Value = True Then
Text1.Text = Text2.Text
ElseIf Option1.Value = True And Option5.Value = True Then
Text2.Text = Val(Text1.Text) * 4 / 5
ElseIf Option1.Value = True And Option6.Value = True Then
Text2.Text = (Val(Text1.Text) * 9 / 5) + 32
End If
If Option2.Value = True And Option5.Value = True Then
Text1.Text = Text2.Text
ElseIf Option2.Value = True And Option4.Value = True Then
Text2.Text = Val(Text1.Text) * 5 / 4
ElseIf Option2.Value = True And Option6.Value = True Then
Text2.Text = (9 / 4 * Val(Text1.Text)) + 32
End If
If Option3.Value = True And Option6.Value = True Then
Text1.Text = Text2.Text
ElseIf Option3.Value = True And Option5.Value = True Then
Text2.Text = 5 / 9 * (Val(Text1.Text) – 32)
ElseIf Option3.Value = True And Option4.Value = True Then
Text2.Text = 4 / 9 * (Val(Text1.Text) – 32)
End If
End Sub
5.    Kemudian klik ganda semua option dengan satu persatu, lalu ketikkan kode/script/listing program berikut ini :
Private Sub Option1_Click()
Call rumus
End Sub
Private Sub Option2_Click()
Call rumus
End Sub
Private Sub Option3_Click()
Call rumus
End Sub
Private Sub Option4_Click()
Call rumus
End Sub
Private Sub Option5_Click()
Call rumus
End Sub
Private Sub Option6_Click()
Call rumus
End Sub
6.    klik ganda text1 lalu ketikkan kode/script/listing program berikut ini :
Private Sub Text1_Change()
Call rumus
End Sub
7.    klik ganda command1 lalu ketikkan kode/script/listing program berikut ini :
Private Sub Command1_Click()
End
End Sub
8.    Jalankan program / run (F5), coba masukkan nilai berapa saja di text1 kemudian centang pada pilihan data inputnya dan data outputnya.
9.    Hasil programnya seperti gambar dibawah ini :
GAMBAR PROGRAM KONVERSI SUHU
10. Selamat mencoba,,,Sesungguhnya ilmu yang bermanfaat adalah ilmu yang disampaikan kepada orang lain walaupun sedikit..!

0 Comment:

Posting Komentar

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Ahenz | Blogger Sejati by Big 4 Share - Private Template | Big Community