You are on page 1of 7

Nama : M Arif Rahman

Nim : 2005151018
Kls : AKP-6A

1. Design

Coding :
Public Class Form1
' Nama : M Arif Rahman
' Kelas : AKP-6A
' Project : Tugas 2
' Ket : Menghitung Jumlah Penerimaan SPP Mahasiswa
' Tgl : 18-03-2023
'-----------------------------------------------------
Dim TrfD, No, Hal, TJSPP, Tsem, x, RSPPD3PAGI, RSPPD3SORE, RD4REGULER,
RD4MANDIRI, TotalRekap As Integer
Dim Spp As Long
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'-----Jenjang
CbJp.Items.Add("Diploma 3")
CbJp.Items.Add("Diploma 4")
'-----Kelas
CbKls.Items.Add("Pagi")
CbKls.Items.Add("Sore")
CbKls.Items.Add("Reguler")
CbKls.Items.Add("Mandiri")
'-----Semester
CbS.Items.Add("2")
CbS.Items.Add("4")
Nama : M Arif Rahman
Nim : 2005151018
Kls : AKP-6A

CbS.Items.Add("6")
CbS.Items.Add("8")
'------Tarif
TrfD = 4000000

End Sub

Private Sub CbJp_SelectedIndexChanged(sender As Object, e As EventArgs) Handles


CbJp.SelectedIndexChanged
CbKls.Items.Clear() : CbKls.Text = ""

If CbJp.Text = "Diploma 3" Then


CbKls.Items.Add("Pagi")
CbKls.Items.Add("Sore")
End If
If CbJp.Text = "Diploma 4" Then
CbKls.Items.Add("Reguler")
CbKls.Items.Add("Mandiri")
End If
End Sub

Private Sub CbKls_SelectedIndexChanged(sender As Object, e As EventArgs) Handles


CbKls.SelectedIndexChanged
CbS.Items.Clear() : CbS.Text = ""
If CbKls.Text = "Pagi" Then
CbS.Items.Add("2")
CbS.Items.Add("4")
CbS.Items.Add("6")
End If
If CbKls.Text = "Sore" Then
CbS.Items.Add("2")
CbS.Items.Add("4")
CbS.Items.Add("6")
End If
If CbKls.Text = "Reguler" Then
CbS.Items.Add("2")
CbS.Items.Add("4")
CbS.Items.Add("6")
CbS.Items.Add("8")
End If
If CbKls.Text = "Mandiri" Then
CbS.Items.Add("2")
CbS.Items.Add("4")
CbS.Items.Add("6")
CbS.Items.Add("8")
End If
End Sub

Private Sub CbS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles


CBS.SelectedIndexChanged
If CbKls.Text = "Pagi" And CbS.Text = "2" Then
Spp = TrfD * 1
End If
Nama : M Arif Rahman
Nim : 2005151018
Kls : AKP-6A

If CbKls.Text = "Pagi" And CbS.Text = "4" Then


Spp = TrfD * 0.8
End If
If CbKls.Text = "Pagi" And CbS.Text = "6" Then
Spp = TrfD * 0.64
End If
If CbKls.Text = "Sore" And CbS.Text = "2" Then
Spp = TrfD * 1.25
End If
If CbKls.Text = "Sore" And CbS.Text = "4" Then
Spp = TrfD * 1
End If
If CbKls.Text = "Sore" And CbS.Text = "6" Then
Spp = TrfD * 0.8
End If
If CbKls.Text = "Reguler" And CbS.Text = "2" Then
Spp = TrfD * 1.5
End If
If CbKls.Text = "Reguler" And CbS.Text = "4" Then
Spp = TrfD * 1.2
End If
If CbKls.Text = "Reguler" And CbS.Text = "6" Then
Spp = TrfD * 0.96
End If
If CbKls.Text = "Reguler" And CbS.Text = "8" Then
Spp = TrfD * 0.77
End If
If CbKls.Text = "Mandiri" And CbS.Text = "2" Then
Spp = TrfD * 2.7
End If
If CbKls.Text = "Mandiri" And CbS.Text = "4" Then
Spp = TrfD * 2.16
End If
If CbKls.Text = "Mandiri" And CbS.Text = "6" Then
Spp = TrfD * 1.73
End If
If CbKls.Text = "Mandiri" And CbS.Text = "8" Then
Spp = TrfD * 1.38
End If
TbSpp.Text = Format(Spp, "###,###")

'---Output
No = No + 1
Lblhal.Text = Hal + 1
x = x + 1
LblNo.Text = LblNo.Text + Str(No) + vbCrLf
LblNim.Text = LblNim.Text + TBNm.Text + vbCrLf
LblNM.Text = LblNM.Text + TbNm.Text + vbCrLf
LblJ.Text = LblJ.Text + CbJp.Text + vbCrLf
LblKO.Text = LblKO.Text + CbKls.Text + vbCrLf
LblS.Text = LblS.Text + CbS.Text + vbCrLf
LBLSPPr.Text = LBLSPPr.Text + TbSpp.Text + vbCrLf

'---Perhitungan Total
Nama : M Arif Rahman
Nim : 2005151018
Kls : AKP-6A

TJSPP = Val(TJSPP) + Val(Spp)


Tsem = Val(Tsem) + 1
LblTS.Text = Format(Tsem, "#")
LblTSpp.Text = Format(TJSPP, "Rp ###,###")

Call Hapusinput()
If x = 10 Then
MsgBox("Tekan tombol OK", MsgBoxStyle.Information, "informasi")
Call HapusOutput()
x = 0
Hal = Hal + 1
End If

End Sub

Sub HapusOutput()
LblNo.Text = "" : LblNM.Text = "" : LblJ.Text = "" : LblJ.Text = "" : LblKO.Text
= "" : LblS.Text = "" : LBLSPPr.Text = "" : LblNim.Text = ""
End Sub
Sub Hapusinput()
TBNm.Clear()
TbNm.Clear()
TbNm.Focus()

End Sub

Private Sub BTNINPUT_Click(sender As Object, e As EventArgs) Handles


BTNINPUT.Click

If CbJp.Text = "Diploma 3" And CbKls.Text = "Pagi" Then


RSPPD3PAGI = Val(RSPPD3PAGI) + Val(Spp)
LBLSPPR.Text = Format(RSPPD3PAGI, "###,###")
End If
If CbJp.Text = "Diploma 3" And CbKls.Text = "Sore" Then
RSPPD3SORE = Val(RSPPD3SORE) + Val(Spp)
D3SOREREKAP.Text = Format(RSPPD3SORE, "###,###")
End If
If CbJp.Text = "Diploma 4" And CbKls.Text = "Reguler" Then
RD4REGULER = Val(RD4REGULER) + Val(Spp)
D4Reguler.Text = Format(RD4REGULER, "###,###")
End If
If CbJp.Text = "Diploma 4" And CbKls.Text = "Mandiri" Then
RD4MANDIRI = Val(RD4MANDIRI) + Val(Spp)
D4Mandiri.Text = Format(RD4MANDIRI, "###,###")
End If
TotalRekap = TJSPP
LbltotalRekap.Text = Format(TotalRekap, "###,###")

End Sub
End Class
ublic Class Form1

Dim TrfD, Jj, Ks, Ss, No As Integer


Dim TSem, TSPP, SPP As Long
Nama : M Arif Rahman
Nim : 2005151018
Kls : AKP-6A

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load


CBJ.Items.Add("D3")
CBJ.Items.Add("D4")

TrfD = 4000000
End Sub

Private Sub CBJ_SelectedIndexChanged(sender As Object, e As EventArgs) Handles


CBJ.SelectedIndexChanged
CBK.Items.Clear() : CBK.Text = " "
If CBJ.Text = ("D3") Then
CBK.Items.Add("Pagi")
CBK.Items.Add("Sore")
End If
If CBJ.Text = ("D4") Then
CBK.Items.Add("Reguler")
CBK.Items.Add("Mandiri")
End If
End Sub

Private Sub CBK_SelectedIndexChanged(sender As Object, e As EventArgs) Handles


CBK.SelectedIndexChanged
CBS.Items.Clear() : CBS.Text = " "
If CBK.Text = ("Pagi") Then
CBS.Items.Add("2")
CBS.Items.Add("4")
CBS.Items.Add("6")
End If
If CBK.Text = ("Sore") Then
CBS.Items.Add("2")
CBS.Items.Add("4")
CBS.Items.Add("6")
End If
If CBK.Text = ("Reguler") Then
CBS.Items.Add("2")
CBS.Items.Add("4")
CBS.Items.Add("6")
CBS.Items.Add("8")
End If
If CBK.Text = ("Mandiri") Then
CBS.Items.Add("2")
CBS.Items.Add("4")
CBS.Items.Add("6")
CBS.Items.Add("8")
End If
End Sub

Private Sub CBS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles


CBS.SelectedIndexChanged
If CBK.Text = "Pagi" And CBS.Text = "2" Then
SPP = TrfD * 1
End If
If CBK.Text = "Pagi" And CBS.Text = "4" Then
SPP = TrfD * 0.8
End If
Nama : M Arif Rahman
Nim : 2005151018
Kls : AKP-6A

If CBK.Text = "Pagi" And CBS.Text = "6" Then


SPP = TrfD * 0.64
End If
If CBK.Text = "Sore" And CBS.Text = "2" Then
SPP = TrfD * 1.25
End If
If CBK.Text = "Sore" And CBS.Text = "4" Then
SPP = TrfD * 1
End If
If CBK.Text = "Sore" And CBS.Text = "6" Then
SPP = TrfD * 0.8
End If
If CBK.Text = "Reguler" And CBS.Text = "2" Then
SPP = TrfD * 1.5
End If
If CBK.Text = "Reguler" And CBS.Text = "4" Then
SPP = TrfD * 1.2
End If
If CBK.Text = "Reguler" And CBS.Text = "6" Then
SPP = TrfD * 0.96
End If
If CBK.Text = "Reguler" And CBS.Text = "8" Then
SPP = TrfD * 0.77
End If
If CBK.Text = "Mandiri" And CBS.Text = "2" Then
SPP = TrfD * 2.7
End If
If CBK.Text = "Mandiri" And CBS.Text = "4" Then
SPP = TrfD * 2.16
End If
If CBK.Text = "Mandiri" And CBS.Text = "6" Then
SPP = TrfD * 1.73
End If
If CBK.Text = "Mandiri" And CBS.Text = "8" Then
SPP = TrfD * 1.38
End If

LBLSPP.Text = Format(SPP, "###,###")


End Sub

Private Sub BTNSIMPAN_Click(sender As Object, e As EventArgs) Handles


BTNSIMPAN.Click
No = No + 1

TSPP = Val(TSPP) + Val(SPP)

LBLN.Text = LBLN.Text + Str(No) + vbCrLf


LBLNIM.Text = LBLNIM.Text + TBNIM.Text + vbCrLf
LBLNM.Text = LBLNM.Text + TBNMhs.Text + vbCrLf
LBLJ.Text = LBLJ.Text + CBJ.Text + vbCrLf
LBLK.Text = LBLK.Text + CBK.Text + vbCrLf
LBLSO.Text = LBLSO.Text + CBS.Text + vbCrLf
LBLSPPO.Text = LBLSPPO.Text + LBLSPP.Text + vbCrLf

LBLSPP.Text = Format(SPP, "###,###")


Nama : M Arif Rahman
Nim : 2005151018
Kls : AKP-6A

End Sub

Private Sub BTNHITUNG_Click(sender As Object, e As EventArgs) Handles


BTNHITUNG.Click
' -- Konversi data input
Jj = Val(CBJ.Text)
Ks = Val(CBK.Text)
Ss = Val(CBS.Text)

'-- Proses
SPP = Jj * Ks * Ss

'-- Output
LBLTSPP.Text = Format(TSPP, "###,###")
End Sub

Output :

You might also like