Pages

Minggu, 14 April 2013

Membuat Aplikasi menghitung Gaji Karyawan dengan Visual Basic



Koding pada aplikasi menghitung gaji karyawan:
·         Variabel:
Dim gol As Integer
Dim anak As String
Dim gapok, gator, pajak, ta As Double
Dim lembur As Single



·         Command Button 1 (OK) :
Private Sub Command1_Click()
gol = Text3.Text
jl = Text4.Text
anak = Text5.Text
Select Case gol
    Case 1
    gapok = 5000000
    lembur = 50000
    jab = "Direktur"
    Case 2
    gapok = 3000000
    lembur = 30000
    jab = "Manager"
    Case 3
    gapok = 2000000
    lembur = 20000
    jab = "supervisor"
    Case Else
    gapok = 1000000
    lembur = 10000
    jab = "operator"
End Select

If anak < 3 Then
ta = anak * 10000
Else
ta = 30000
End If

gator = gapok + (lembur * jl) + ta
pajak = gator * (10 / 100)
gaber = gator + pajak

Text6.Text = jab
Text7.Text = gator
Text8.Text = gaber
End Sub




·         Command Button 2 : Clear
Private Sub Command2_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text4.Text = " "
Text5.Text = " "
Text6.Text = " "
Text7.Text = " "
Text8.Text = " "
Text1.SetFocus
End Sub

·         Command Button 3 (exit) :
Private Sub Command3_Click()
End
End Sub


  • Tampilan Program

1 komentar:

  1. kak boleh minta tutorialnya lengkap nggak dr awal sampek akhir,,,

    BalasHapus