Selasa, 11 Oktober 2011

Program Visual Basic Perhitungan Nilai Mahasiswa

Posted by Unknown On Selasa, Oktober 11, 2011 | No comments

Sintaknya :

Private Sub Form_Activate()
habsen.Enabled = False
htugas.Enabled = False
huts.Enabled = False
huas.Enabled = False
txtabsen.SetFocus
End Sub

Private Sub txtabsen_Change()
habsen = 0.1 * Val(txtabsen.Text)
End Sub

Private Sub txttugas_Change()
htugas = 0.2 * Val(txttugas.Text)
End Sub

Private Sub txtuts_Change()
huts = 0.3 * Val(txtuts.Text)
End Sub

Private Sub txtuas_Change()
huas = 0.4 * Val(txtuas.Text)
End Sub

Private Sub cmdhitung_Click()
'Menghitung Total Nilai
txttotal = Val(habsen.Text) + Val(htugas.Text) + Val(huts.Text) + Val(huas.Text)
'Menghitung Grade
If txttotal >= 80 And txttotal <= 100 Then txtgrade = "A" Else If txttotal >= 69 And txttotal <= 79 Then txtgrade = "B" Else If txttotal >= 56 And txttotal <= 68 Then txtgrade = "C" Else If txttotal >= 40 And txttotal <= 55 Then
txtgrade = "D"
Else
txtgrade = "E"
End If
End If
End If
End If
'Menghitung Keterangan
If txtgrade = "A" Or txtgrade = "B" Or txtgrade = "C" Then
txtket = "LULUS"
Else
txtket = "GAGAL"
End If
End Sub

Private Sub cmdbersih_Click()
txtabsen.Text = " "
txttugas.Text = " "
txtuts.Text = " "
txtuas.Text = " "
habsen.Text = " "
htugas.Text = " "
huts.Text = " "
huas.Text = " "
txttotal.Text = " "
txtgrade.Text = " "
txtket.Text = " "
txtabsen.SetFocus
End Sub

Private Sub cmdkeluar_Click()
x = MsgBox("Anda Ingin Keluar Dari Form Ini?", vbQuestion + vbOKCancel, "Informasi")
If x = vbOK Then
End
End If
End Sub

0 komentar:

Posting Komentar

Blog Archive

Blogroll