Postingan Jawaban No 02.
Nama : Mara Husein
Npm : 0911392
Kelas : TI-A Siang S-0908
Untuk kasus lihat disini.... (Kasus)
Soal hal 32.
Design lah Form Seperti Di bawah ini.
Ketentuan :
- 2 Digit karakter dari sebelah kiri menentukan tahun masuk.
- 1 Digit dari karakter ke 3 menentukan jenjang.
- 2 Digit dari karakter ke 4 menentukan jurusan.
- Nilai huruf berdasarkan Nilai Angka yang diinput.
- Nilai huruf muncul ketika terjadi penekanan tombol ENTER pada Nilai Angka.
Solusi :
Listing Program :
___________________________________________________________________________________
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
rancangtabel()
End Sub
-------------------------------------------------------------------------------------------------------------------
Private Sub npm_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles npm.KeyPress
If e.KeyChar = Chr(13) Then
nama.Focus()
End If
End Sub
------------------------------------------------------------------------------------------------------------------
Private Sub npm_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles npm.TextChanged
Dim i, x, y As String
i = Microsoft.VisualBasic.Left(npm.Text, 2)
x = Microsoft.VisualBasic.Mid(npm.Text, 3, 1)
y = Microsoft.VisualBasic.Mid(npm.Text, 4, 2)
If i = "09" Then
tahun.Text = "2009"
ElseIf i = "08" Then
tahun.Text = "2008"
ElseIf i = "07" Then
tahun.Text = "2007"
ElseIf i = "06" Then
tahun.Text = "2006"
End If
If x = "0" Then
jenjang.Text = "D-3"
If y = "02" Then
jurusan.Text = "Manajemen Informatika"
ElseIf y = "03" Then
jurusan.Text = "Komputerisasi Akuntansi"
End If
ElseIf x = "1" Then
jenjang.Text = "S-1"
If y = "13" Then
jurusan.Text = "Tek.Informatika"
ElseIf y = "12" Then
jurusan.Text = "Sis.Informasi"
End If
End If
End Sub
-----------------------------------------------------------------------------------------------------------------
Private Sub nama_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles nama.KeyPress
If e.KeyChar = Chr(13) Then
nangka.Focus()
End If
End Sub
----------------------------------------------------------------------------------------------------------------
Private Sub btnbersih_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbersih.Click
npm.Text = ""
nama.Text = ""
jenjang.Text = ""
jurusan.Text = ""
nangka.Text = ""
nhuruf.Text = ""
tahun.Text = ""
End Sub
---------------------------------------------------------------------------------------------------------------
Private Sub nangka_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles nangka.KeyPress
If e.KeyChar = Chr(13) Then
If nangka.Text >= 85 Then
nhuruf.Text = "A"
ElseIf nangka.Text >= 75 Then
nhuruf.Text = "B"
ElseIf nangka.Text >= 65 Then
nhuruf.Text = "C"
ElseIf nangka.Text >= 50 Then
nhuruf.Text = "D"
Else
nhuruf.Text = "E"
End If
End If
End Sub
---------------------------------------------------------------------------------------------------------------
Sub rancangtabel()
With LV
.Columns.Add("NPM", 70, HorizontalAlignment.Center)
.Columns.Add("Nama", 120, HorizontalAlignment.Center)
.Columns.Add("Jurusan", 100, HorizontalAlignment.Center)
.Columns.Add("Jenjang", 70, HorizontalAlignment.Center)
.Columns.Add("Tahun Masuk", 70, HorizontalAlignment.Center)
.Columns.Add("Nilai angka", 70, HorizontalAlignment.Center)
.Columns.Add("Nilai huruf", 70, HorizontalAlignment.Center)
.GridLines = True
.FullRowSelect = True
.View = View.Details
End With
End Sub
--------------------------------------------------------------------------------------------------------------
Sub masuktabel()
Dim lst As New ListViewItem
With lst
.Text = Npm.Text
.SubItems.Add(Nama.Text)
.SubItems.Add(jurusan.Text)
.SubItems.Add(jenjang.Text)
.SubItems.Add(tahun.Text)
.SubItems.Add(nangka.Text)
.SubItems.Add(nhuruf.Text)
LV.Items.Add(lst)
End With
End Sub
--------------------------------------------------------------------------------------------------------------
Private Sub btnsimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsimpan.Click
masuktabel()
End Sub
--------------------------------------------------------------------------------------------------------------
Private Sub btndata_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndata.Click
LV.Items.Clear()
End Sub
--------------------------------------------------------------------------------------------------------------
Private Sub btnsemuadata_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsemuadata.Click
LV.Items.Remove(LV.SelectedItems(0))
End Sub
--------------------------------------------------------------------------------------------------------------
Private Sub btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkeluar.Click
End
End Sub
End Class
_______________________________________________________________________
Dan Tampilan Hasil Program :
Alhamdulillah,,,,,,
"ada pasir di bawa kuda"
"akhirnya,,,,selesai juga"
untuk mendownload file mahasiswa yang sudah jadi,,,,
silahkan anda download disini....!
pasword : ucok_siburnung
Tidak ada komentar:
Posting Komentar