TUGAS 2 VB

1. gaji 1

 

 

 

 

 

 

Private Sub Combo1_Click()

Dim GL As String

Dim GP, TJ, PJ, TT As Currency

GL = Combo1.Text

If GL = “I” Then

GP = 1500000

TJ = 150000

ElseIf GL = “II” Then

GP = 2000000

TJ = 200000

ElseIf GL = “III” Then

GP = 2500000

TJ = 250000

Else

GP = 3000000

TJ = 300000

End If

PJ = (GP + TJ) / 10

TT = GP + TJ – PJ

Text4.Text = GP

Text5.Text = TJ

Text6.Text = PJ

Text7.Text = TT

End Sub

 

 

Private Sub Command1_Click()

Text1.Text = “”

Text2.Text = “”

Text3.Text = “”

Text4.Text = “”

Text5.Text = “”

Text6.Text = “”

Text7.Text = “”

Combo1.Text = “”

Text1.SetFocus

End Sub

 

Private Sub Command2_Click()

Text1.Text = “”

Text2.Text = “”

Text3.Text = “”

Text4.Text = “”

Text5.Text = “”

Text6.Text = “”

Text7.Text = “”

Combo1.Text = “”

Text1.SetFocus

End Sub

 

Private Sub Command3_Click()

Unload Me

End Sub

 

Private Sub Form_Load()

Combo1.AddItem “I”

Combo1.AddItem “II”

Combo1.AddItem “III”

Combo1.AddItem “IV”

End Sub

 

2. gaji 2

 

 

 

 

 

 

 

Private Sub Command1_Click()

Dim GP, TJ, POT, GK, PJ, GD As Currency

GP = Val(Text1.Text)

TJ = Val(Text2.Text)

POT = Val(Text3.Text)

GK = GP + TJ – POT

PJ = (GK * 10) / 100

GD = GK – PJ

Text4.Text = GK

Text5.Text = PJ

Text6.Text = GD

End Sub

 

Private Sub Command2_Click()

Text1.Text = “”

Text2.Text = “”

Text3.Text = “”

Text4.Text = “”

Text5.Text = “”

Text6.Text = “”

Text1.SetFocus

End Sub

 

Private Sub Command3_Click()

Unload Me

End Sub

 

3.huruf mutu

 

 

 

 

 

 

 

Private Sub Combo1_Click()

Dim NPM, NM, JR As String

NPM = Combo1.Text

If NPM = “11100050” Then

NM = “LILIAN DWI SUCIPTO”

JR = “SISTEM INFORMASI_S1”

ElseIf NPM = “11100051” Then

NM = “RITA MUSTIKA”

JR = “SISTEM INFORMASI_S1”

Else

NM = “YENI FITRIA”

JR = “SISTEM INFORMASI_S1”

End If

Text2.Text = NM

Text3.Text = JR

End Sub

 

Private Sub Command1_Click()

Dim NQ, NT, UTS, UAS, NA As Integer

Dim HM As String

NQ = Val(Text4.Text)

NT = Val(Text5.Text)

UTS = Val(Text6.Text)

UAS = Val(Text7.Text)

NA = (NQ + NT + UTS + UAS) / 4

If NA < 51 Then

HM = “E”

ElseIf NA < 61 Then

HM = “D”

ElseIf NA < 71 Then

HM = “C”

ElseIf NA < 81 Then

HM = “B”

Else

HM = “A”

End If

Text8.Text = NA

Text9.Text = HM

End Sub

 

Private Sub Command2_Click()

Text1.Text = “”

Text2.Text = “”

Text3.Text = “”

Text4.Text = “”

Text5.Text = “”

Text6.Text = “”

Text7.Text = “”

Text8.Text = “”

Text9.Text = “”

Combo1.Text = “”

Combo1.SetFocus

End Sub

 

Private Sub Command3_Click()

Unload Me

End Sub

 

Private Sub Form_Load()

Combo1.AddItem “11100050”

Combo1.AddItem “11100051”

Combo1.AddItem “11100052”

End Sub

 

 

Private Sub Text4_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text5.SetFocus

End If

End Sub

 

Private Sub Text5_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text6.SetFocus

End If

End Sub

 

 

Private Sub Text6_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text7.SetFocus

End If

End Sub

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 )

Gambar Twitter

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

Foto Facebook

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

Foto Google+

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

Connecting to %s