TUGAS PEMROGRAMAN 1

PROGRAM 1

TUGAS1

tugas1

Private Sub bilangan1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

bilangan2.SetFocus

End If

End Sub

 

Private Sub cmdbersih_Click()

bilangan1.SetFocus

bilangan1 = “”

bilangan2 = “”

bilanganhasil = “”

End Sub

 

Private Sub cmdhitung_Click()

bilanganhasil = Val(bilangan1) * Val(bilangan2)

End Sub

 

Private Sub cmdkeluar_Click()

End

End Sub

 

 

TUGAS 2

Capture 2

Private Sub bilangan1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

bilangan2.SetFocus

End If

End Sub

 

 

Private Sub bilangan2_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

bilanganhasil.SetFocus

bilanganhasil = Val(bilangan1) * Val(bilangan2)

End If

End Sub

 

Private Sub cmdbersih_Click()

bilangan1.SetFocus

bilangan1 = “”

bilangan2 = “”

bilanganhasil = “”

End Sub

 

Private Sub Cmdhitung_Click()

bilanganhasil = Val(bilangan1) * Val(bilangan2)

End Sub

 

Private Sub cmdkeluar_Click()

End

End Sub

 

 

 

PROGRAM 2

TUGAS 3

3

Private Sub cmdbatal_Click()

satu.SetFocus

satu = “”

dua = “”

tiga = “”

empat = “”

lima = “”

enam = “”

tujuh = “”

delapan = “”

sembilan = “”

sepuluh = “”

sebelas = “”

duabelas = “”

 

End Sub

 

Private Sub cmdkeluar_Click()

End

End Sub

 

Private Sub cmdlagi_Click()

satu.SetFocus

satu = “”

dua = “”

tiga = “”

empat = “”

lima = “”

enam = “”

tujuh = “”

delapan = “”

sembilan = “”

sepuluh = “”

sebelas = “”

duabelas = “”

End Sub

 

Private Sub cmdproses_Click()

If sepuluh = “” Or sebelas = “” Then

tiga = Val(satu) + Val(dua)

enam = Val(empat) * Val(lima)

sembilan = Val(tujuh) – Val(delapan)

duabelas = 0

Else

tiga = Val(satu) + Val(dua)

enam = Val(empat) * Val(lima)

sembilan = Val(tujuh) – Val(delapan)

duabelas = Val(sepuluh) / Val(sebelas)

End If

End Sub

 

Private Sub delapan_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

sepuluh.SetFocus

End If

End Sub

 

Private Sub dua_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

empat.SetFocus

End If

End Sub

 

 

Private Sub empat_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

lima.SetFocus

End If

End Sub

 

Private Sub lima_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

tujuh.SetFocus

End If

End Sub

 

Private Sub satu_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

dua.SetFocus

End If

End Sub

 

Private Sub sepuluh_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

sebelas.SetFocus

End If

End Sub

 

Private Sub tujuh_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

delapan.SetFocus

End If

End Sub

 

 

TUGAS 4

Capture 4.PNG

Private Sub cmdbatal_Click()

Penjum1.SetFocus

Penjum1 = “”

penjum2 = “”

penjumhasil = “”

perkal1 = “”

perkal2 = “”

perkalhasil = “”

pengur1 = “”

pengur2 = “”

pengurhasil = “”

pembag1 = “”

pembag2 = “”

pembaghasil = “”

End Sub

 

Private Sub cmdkeluar_Click()

End

End Sub

 

Private Sub cmdlagi_Click()

Penjum1.SetFocus

Penjum1 = “”

penjum2 = “”

penjumhasil = “”

perkal1 = “”

perkal2 = “”

perkalhasil = “”

pengur1 = “”

pengur2 = “”

pengurhasil = “”

pembag1 = “”

pembag2 = “”

pembaghasil = “”

End Sub

 

Private Sub cmdproses_Click()

 

penjumhasil = Val(Penjum1) + Val(penjum2)

perkalhasil = Val(perkal1) * Val(perkal2)

pengurhasil = Val(pengur1) – Val(pengur2)

pembaghasil = Val(pembag1) / Val(pembag2)

 

End Sub

 

Private Sub pembag1_KeyPress(keyAsCII As Integer)

If keyAsCII = 13 Then

pembag2.SetFocus

End If

End Sub

Private Sub pembag2_KeyPress(keyAsCII As Integer)

If keyAsCII = 13 Then

pembaghasil = Val(pembag1) / Val(pembag2)

End If

End Sub

 

Private Sub pengur1_KeyPress(keyAsCII As Integer)

If keyAsCII = 13 Then

pengur2.SetFocus

End If

End Sub

 

Private Sub pengur2_keypress(keyAsCII As Integer)

If keyAsCII = 13 Then

pengurhasil = Val(pengur1) – Val(pengur2)

pembag1.SetFocus

End If

End Sub

 

Private Sub Penjum1_KeyPress(keyAsCII As Integer)

If keyAsCII = 13 Then

penjum2.SetFocus

End If

End Sub

 

 

Private Sub Penjum2_KeyPress(keyAsCII As Integer)

If keyAsCII = 13 Then

penjumhasil = Val(Penjum1) + Val(penjum2)

perkal1.SetFocus

End If

End Sub

 

 

Private Sub perkal1_KeyPress(keyAsCII As Integer)

If keyAsCII = 13 Then

perkal2.SetFocus

End If

End Sub

 

 

Private Sub perkal2_KeyPress(keyAsCII As Integer)

If keyAsCII = 13 Then

perkalhasil = Val(perkal1) * Val(perkal2)

pengur1.SetFocus

End If

End Sub

 

 

 

PROGRAM 3

TUGAS 5

tugas5

Private Sub cmdhitung_Click()

hasildiskon = Val(hasilawal) * 0.1

hasilakhir = Val(hasilawal) – Val(hasildiskon)

End Sub

 

Private Sub cmdquit_Click()

End

End Sub

 

Private Sub cmdulangi_Click()

hasilawal.SetFocus

hasilawal = “”

hasildiskon = “”

hasilakhir = “”

End Sub

 

 

Private Sub hasilawal_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

hasilakhir.SetFocus

hasildiskon = Val(hasilawal) * 0.1

hasilakhir = Val(hargaawal) – Val(hargadiskon)

 

End If

End Sub

 

 

TUGAS 6

tugas gambar 6.PNG

Private Sub cmdhitung_Click()

hasildiskon = Val(hasilawal) * 0.1

hasilakhir = Val(hasilawal) – Val(hasildiskon)

End Sub

 

Private Sub cmdquit_Click()

End

End Sub

 

Private Sub cmdulang_Click()

hasilawal.SetFocus

hasilawal = “”

hasildiskon = “”

hasilakhir = “”

hasilquit = “”

End Sub

 

Private Sub hasilawal_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

hasilakhir.SetFocus

hasildiskon = Val(hasilawal) * 0.1

hasilakhir = Val(hasilawal) – Val(hasildiskon)

End If

End Sub


 

PROGRAM 4

TUGAS 7

TUGAS7.PNG

Private Sub cmdkeluar_Click()

End

End Sub

 

Private Sub cmdproses_Click()

hasilkotor = Val(hasilpokok) + Val(hasiltunjangan) – Val(hasilpotongan)

hasilpajak = Val(hasilkotor) * 0.1

hasilditerima = Val(hasilkotor) – Val(hasilpajak)

End Sub

 

Private Sub cmdulang_Click()

hasilpokok.SetFocus

hasilpokok = “”

hasiltunjangan = “”

hasilpotongan = “”

hasilkotor = “”

hasilpajak = “”

hasilditerima = “”

End Sub

 

Private Sub hasilgaji_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

hasiltunjangan.SetFocus

End If

End Sub

 

Private Sub hasilpotongan_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

End If

End Sub

 

Private Sub hasiltunjangan_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

hasilpotongan.SetFocus

End If

End Sub

 

 

TUGAS 8

tugas8

Private Sub cmdkeluar_Click()

End

End Sub

 

Private Sub cmdproses_Click()

hasilkotor = Val(hasilpokok) + Val(hasiltunjangan) – Val(hasilpotongan)

hasilpajak = Val(hasilkotor) * 0.1

hasilditerima = Val(hasilkotor) – Val(hasilpajak)

End Sub

 

Private Sub cmdulang_Click()

hasilpokok.SetFocus

hasilpokok = “”

hasiltunjangan = “”

hasilpotongan = “”

hasilkotor = “”

hasilpajak = “”

hasilditerima = “”

End Sub

 

 

 

Private Sub hasilgaji_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

hasiltunjangan.SetFocus

End If

End Sub

 

Private Sub hasilpotongan_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

hasilkotor = Val(hasilpokok) + Val(hasiltunjangan) – Val(hasilpotongan)

hasilpajak = Val(hasilkotor) * 0.1

hasilditerima = Val(hasilkotor) – Val(hasilpajak)

End If

End Sub

 

Private Sub hasiltunjangan_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

hasilpotongan.SetFocus

End If

End Sub

 

 

 

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s