·
Langkah Kedua klik pada
create project untuk memulai project baru, atau masuk ke menu File >>
New Project. Seperti pada gambar di atas.
·
Langkah ketiga buatlah
desain form seperti gambar di bawah ini. Masukkan 1 groupbox, 7 label, 7 textbox, dan 3 command
button. Lalu ubahlah propertiesnya seperti pada tabel berikut:
Objek
|
Text
|
Name
|
Label1
|
Absen
|
lblAbsen
|
Label2
|
Tugas
|
lblTugas
|
Label3
|
Keaktifan
|
lblKeaktifan
|
Label4
|
UTS
|
lblUts
|
Label5
|
UAS
|
lblUas
|
Label6
|
Nilai Akhir
|
lblNilaiakhir
|
Label7
|
Huruf
|
lblHuruf
|
Textbox1
|
-
|
txtAbsen
|
Textbox2
|
-
|
txtTugas
|
Textbox3
|
-
|
txtKeaktifan
|
Textbox4
|
-
|
txtUts
|
Textbox5
|
-
|
txtUas
|
Textbox6
|
-
|
txtNilaiakhir
|
Textbox7
|
-
|
txtHurf
|
Button1
|
Check
|
btnCheck
|
Button2
|
Clear
|
btnClear
|
Button3
|
Exit
|
btnExit
|
·
Langkah keempat masukan
koding berikut
Public Class Form1
Dim jumlah As Integer
Dim absen As Decimal, tugas As Decimal, keaktifan As Decimal, uts As Decimal, uas As Decimal
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Close()
End Sub
Private Sub btnCheck_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCheck.Click
absen = txtAbsen.Text * 20 / 100
tugas = txtTugas.Text * 15 / 100
keaktifan = txtKeaktifan.Text * 10 / 100
uts = txtUts.Text * 25 / 100
uas = txtUas.Text * 30 / 100
jumlah = absen + tugas + keaktifan + uts + uas
txtNilaiAkhir.Text = jumlah
If txtNilaiAkhir.Text >= 85 Then
txtHuruf.Text = "A"
ElseIf txtNilaiAkhir.Text >= 70 Then
txtHuruf.Text = "B"
ElseIf txtNilaiAkhir.Text >= 56 Then
txtHuruf.Text = "C"
ElseIf txtNilaiAkhir.Text >= 40 Then
txtHuruf.Text = "D"
Else
txtHuruf.Text = "E"
End If
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
txtAbsen.Clear()
txtHuruf.Clear()
txtKeaktifan.Clear()
txtNilaiAkhir.Clear()
txtTugas.Clear()
txtUas.Clear()
txtUts.Clear()
End Sub
End Class
·
Langkah kelima bila koding sudah dimasukan running
programnya dan coba isi sesuai keinginan.
No comments:
Post a Comment