You are on page 1of 3

1EB01

Ika widya

20221894

Tugas Pertemuan 7

No. 1

Codding :
Public Class P7_No1
Dim jamk, jaml, gaji As Integer
Dim total As String

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
jamk = txtjamkerja.Text
jaml = txtjamlembur.Text
gaji = txtgajipokok.Text
total = gaji + (jamk * 20000) + (jaml * 22500)
texttotalgaji.Text = total
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
textnama.Text = ""
textjamkerja.Text = ""
textjamlembur.Text = ""
textgajipokok.Text = ""
texttotalgaji.Text = ""
textnama.Focus()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
End Class

No. 2
Codding:
Public Class P7_no2
Dim tugas, uts, uas, Nilai As Integer
Dim huruf, komentar As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
tugas = txtNT.Text
uts = txtUTS.Text
uas = txtUAS.Text
Nilai = (0.2 * tugas + 0.3 * uts + 0.5 * uas)

If Nilai >= 85 Then


huruf = "A"
komentar = "Nilai Anda Sangat Baik, Anda LULUS !.. Pertahankan!"
ElseIf Nilai >= 76 Then
huruf = "B"
komentar = "Nilai Anda Baik, Anda LULUS !.. Pertahankan!"
ElseIf Nilai >= 66 Then
huruf = "C"
komentar = "Nilai Anda Cukup, Anda LULUS !.. Tingkatkan!"
ElseIf Nilai >= 56 Then
huruf = "D"
komentar = "Nilai Anda Kurang, Anda LULUS !.. Belajar Lebih
Giat!"
Else
huruf = "E"
komentar = "Maaf.. Anda TIDAK LULUS !.. Perbaiki Semester Depan!"
End If
textANGKA.Text = Nilai
textHURUF.Text = huruf
textKOMENTAR.Text = komentar
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
textNPM.Text = ""
textNAMA.Text = ""
textNT.Text = ""
textUTS.Text = ""
textUAS.Text = ""
textANGKA.Text = ""
textHURUF.Text = ""
textKOMENTAR.Text = ""
textNPM.Focus()
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
End Class

You might also like