.
Dengan konsep tersebut, dapat dibuat sebuah aplikasi untuk menghitung
luas trapesium menggunakan program visual basic 6.0 yang nantinya akan
berguna untuk membantu menyelesaikan masalah mencari luas trapesium
dalam ilmu matematika.1. LANGKAH-LANGKAH PEMBUATAN APLIKASI
Langkah-1 :
Masukkan Obyek yang diperlukan kedalam form, seperti gambar berikut :

Langkah-2 :
Aturlah properti masing-masing form/obyek yang dipergunakan, dengan minimal memuat pengaturan sebagai berikut :
|
NO
|
FORM/OBYEK
|
PROPERTY
|
SETTING
|
|
1
|
Form | Name | TRAPESIUM |
| Caption | LUAS TRAPESIUM | ||
| Backcolor | &H8000000F& | ||
|
2
|
Label 1 | Caption | MEGHITUNG LUAS TRAPESIUM |
| BackColor | &H0000FFFF& | ||
| BackStyle | 1-Opaque | ||
| Font | Snap ITC, 20, Bold Oblique | ||
| ForeColor | &H00000000& | ||
|
3
|
Label 2 | Caption | Sisi Pertama |
| Font | Snap ITC, 12, Bold | ||
| ForeColor | &H00000000& | ||
|
4
|
Label 3 | Caption | Sisi Kedua |
| Font | Snap ITC, 12, Bold | ||
| ForeColor | &H00000000& | ||
|
5
|
Label 4 | Caption | Tinggi |
| Font | Snap ITC, 12, Bold | ||
| ForeColor | &H00000000& | ||
|
6
|
Label 5 | Caption | Luas |
| Font | Snap ITC, 12, Bold | ||
| ForeColor | &H00000000& | ||
|
7
|
Text1 | Name | txtsisipertama |
| Font | Snap ITC, 12, Bold | ||
| Text | <kosongkan> | ||
|
8
|
Text2 | Name | txtsisikedua |
| Font | Snap ITC, 12, Bold | ||
| Text | <kosongkan> | ||
|
9
|
Text3 | Name | txttinggi |
| Font | Snap ITC, 12, Bold | ||
| Text | <kosongkan> | ||
|
10
|
Text4 | Name | Txtluas |
| Font | Snap ITC, 12, Bold | ||
| Text | <kosongkan> | ||
|
11
|
Command1 | Name | Cmdhapus |
| Caption | HAPUS | ||
| Font | Snap ITC, 14, Bold Oblique | ||
| BackColor | &H00000000& | ||
| Style | 0 – Standard | ||
|
12
|
Command2 | Name | Cmdkeluar |
| Caption | KELUAR | ||
| Font | Snap ITC, 14, Bold Oblique | ||
| BackColor | &H00000000& | ||
| Style | 0 – Standard | ||
|
13
|
Command3 | Name | Cmdhitung |
| Caption | HITUNG | ||
| Font | Snap ITC, 14, Bold Oblique | ||
| BackColor | &H00000000& | ||
| Style | 0 – Standard |
Ketikkan code program sebagai berikut :
Private Sub Cmdhapus_Click()
MsgBox (“Apakah Anda Yakin Ingin Menghapus Hasil Ini?”)
txtsisipertama.Text = “”
txtsisikedua.Text = “”
txttinggi.Text = “”
txtluas.Text = “”
txtsisipertama.SetFocus
End Sub
Private Sub Cmdhitung_Click()
Dim sisipertama, sisikedua, tinggi, luas As Single
sisipertama = Val(txtsisipertama.Text)
sisikedua = Val(txtsisikedua.Text)
tinggi = Val(txttinggi.Text)
If txtsisipertama.Text = “” Or txtsisikedua.Text = “” Or txttinggi.Text = “” Then
MsgBox (“Tolong masukkan nilai sisi pertama, sisi kedua, dan tinggi terlebih dulu”)
ElseIf sisipertama > 0 And sisikedua > 0 And tinggi > 0 Then
luas = 1 / 2 * (sisipertama + sisikedua) * tinggi
txtluas.Text = luas
End If
End Sub
Private Sub Cmdkeluar_Click()
MsgBox (“TERIMAKASIH”)
End
End Sub
Langkah-4 :
Simpan Program dengan cara : File – Save Project As – (pilih lokasi menyimpan dan nama file) – OK
Langkah-5 :
Agar program dapat digunakan oleh pengguna lain ekspor program kebentuk .EXE dengan cara : File – Make APLIKASI MENGHITUNG LUAS TRAPESIUM.exe
Langkah-6 :
Gambaran Desain Akhir ( Output )

klik disini
Tidak ada komentar:
Posting Komentar