Perhitungan Nilai Mahasiswa
1.Mendesign pada Form seperti gambar di bawah ini
Properties
Objeck | Properti | Setting |
Form | Name Caption Width Heigth | FrmLat2 Perhitungan Nilai Mahasiswa 5000 3500 |
Label1 | Caption | NPM |
Label2 | Caption | Nama Mahasiswa |
Label3 | Caption | Mata Kuliah |
Label4 | Caption | Nilai Mid |
Label5 | Caption | Nilai Semester |
Label6 | Caption | Nilai Kehadiran |
Label7 | Caption | Nilai Tugas |
Label8 | Caption | Total Nilai |
Text1 | Name | npm |
Text2 | Name | nama |
Text3 | Name | mk |
Text4 | Name | nmid |
Text5 | Name | ns |
Text6 | Name | nk |
Text7 | name | nt |
Text8 | name | total |
Command1 | Name Caption | Cmdhitung &Hitung |
Command2 | Name Caption | Cmdhapus &Hapus |
Command3 | Name Caption | Cmdselesai &Selesai |
Double Click Form anda dan isikan kode program di bawah ini
Sub hapus()
npm.Text = ""
nama.Text = ""
mk.Text = ""
nmid.Text = ""
ns.Text = ""
nk.Text = ""
nt.Text = ""
total.Text = ""
end sub
Private Sub Cmdhapus_Click()
Hapus
npm.setFocus
End Sub
Private Sub Cmdhitung_Click()
total= 0.1 * nk.Text + 0.15 * nt.Text + 0.3 * nmid.Text + 0.45 * ns.Text
End Sub
Private Sub Cmdselesai_Click()
Unload Me
End Sub
Private Sub Form_Load()
hapus
End Sub
Menjalankan program Tekan F5