- Ini adalah tampilan dari program penghitung kelulusan:
*command clear tidak bisa di click karenakan data masih kosong- Ini adalah contoh data inputan nilai mahasiswa :
*Setelah command proses di click maka comand Proses tidak bisa di click kembali kecuali mengcklik dahulu command clear.*Nilai Angka Mutu akan Diambil dari Nilai UTS sebesar 30%, Nilai UAS Sebesar 40%, nilai Tugas 20%, dan Nilai Absensi 10%.
- Nah ini Source Code dari tampilan program diatas:
'------------------------------------------
Dim angka_mutu As Integer
'------------------------------------------
'------------------------------------------
Source code yang terdapat didalam command "Clear"
'------------------------------------------
Private Sub cmdclear_Click()
cmdproses.Enabled = True '--- > berfungsi untuk mengunci command "proses"
Text1.Text = "" '
Text2.Text = "" '
Text3.Text = "" '
Text4.Text = "" '>>>> Untuk mengubah text2 ang terdapat di dalam program menjadi kosong
Text5.Text = "" '
Text6.Text = "" '
Text7.Text = "" '
Text8.Text = "" '
End Sub
'------------------------------------------
'------------------------------------------
Source Code pada Command "EXIT"
'------------------------------------------
Private Sub cmdexit_Click()
If MsgBox("Anda ingin keluar?", vbYesNo) = vbYes Then
End
Else
End If
End Sub
'------------------------------------------
'------------------------------------------
Soucre Code pada Form load
'------------------------------------------
Private Sub Form_Load()
cmdclear.Enabled = False '>>>>>Berfungsi untuk mengunci command clear program 'pada saat pertama kali membuka
End Sub
'------------------------------------------
'------------------------------------------
Soucre Code Pada Command "PROSES"
'------------------------------------------
Private Sub cmdproses_Click()
cmdclear.Enabled = True
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Then
MsgBox ("Maaf Nilai Tidak kumplit") '-----Akan ada peringatan jika Data inputan kosong
Else
If Text1.Text > 100 Or Text1.Text = "" Then
MsgBox ("maaf Masukan angka 0-100 pada Nilai UTS")
Else
angka_mutu = Text1.Text * 0.3 + Text2.Text * 0.4 + Text3.Text * 0.2 + Text4.Text * 0.1
Text5.Text = angka_mutu
If Text2.Text > 100 Then
MsgBox ("maaf Masukan angka 0-100 pada Nilai UAS")
Else
If Text3.Text > 100 Then
MsgBox ("maaf Masukan angka 0-100 pada Nilai Tugas")
Else
If Text4.Text > 100 Then
MsgBox ("maaf Masukan angka 0-100 pada Nilai Absensi")
Else
If angka_mutu > 76 And angka_mutu <= 100 Then Text6.Text = "A" cmdproses.Enabled = False Else If angka_mutu > 66 And angka_mutu <= 75 Then Text6.Text = "B" cmdproses.Enabled = False Else If angka_mutu > 55 And angka_mutu <= 65 Then Text6.Text = "C" cmdproses.Enabled = False Else If angka_mutu > 40 And angka_mutu <= 54 Then Text6.Text = "D" cmdproses.Enabled = False Else If angka_mutu >= 0 And angka_mutu <= 39 Then
Text6.Text = "E"
cmdproses.Enabled = False
End If
End If
End If
End If
End If
If Text6.Text = "A" Then
Text7.Text = "Cumlaude"
Else
If Text6.Text = "B" Then
Text7.Text = "Sangat Memuaskan"
Else
If Text6.Text = "C" Then
Text7.Text = "Cukup Memuaskan"
Else
If Text6.Text = "D" Then
Text7.Text = "Kurang Memuaskan"
Else
If Text6.Text = "E" Then
Text7.Text = "Buruk"
End If
End If
End If
End If
End If
If Text6.Text = "A" Then
Text8.Text = "Lulus"
Else
If Text6.Text = "B" Then
Text8.Text = "Lulus"
Else
If Text6.Text = "C" Then
Text8.Text = "Lulus"
Else
Text8.Text = "Tidak Lulus"
End If
End If
End If
End If
End If
End If
End If
End If
End Sub
Nah itu dia program kelulusan mahasiswa yang saya buat, semoga contoh program ini dapat membantu anda dalam pembuatan program2 Visual Basic yg lain, , , amin. . .
Selamat Mencoba!!!!

Tidak ada komentar:
Posting Komentar