Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Nama : Elvi Annisa Putri Lubis

Kelas : AKP – 6B
Nim : 2005151044

1. DESIGN :
2. CODING :

Public Class Form1

' Nama Projek = Tugas 4


' Tanggal = 20-04-2023
' Oleh = Elvi Annisa Putri Lubis
' Ket = Penyusutan Aktiva Tetap Metode Satuan Produksi

Dim X, Y, THN, HP, NS, UA, P, AKP, NB, TP, TA, JP(10) As Integer
Dim Tahun, TJP As Long

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


X = 1
Y = 1
Me.Show() : TbNA.Focus()
End Sub

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


BtnInputTP.Click
Me.TabControl1.SelectedIndex = 1
HP = Val(TbHP.Text)
NS = Val(TbNS.Text)
UA = Val(TbUA.Text)
TA = Val(TbTA.Text)
LBLJD.Text = UA
LBLTo.Text = TA
End Sub

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


BTNInputJP.Click
JP(X) = Val(TBP.Text)
If X < UA Then
X = X + 1
TBP.Text = "" : TBP.Focus()
Else
TBP.Enabled = False
BTNInputJP.Visible = False
Call ProsesJumlahProduksi()
Call ProsesPenyusutan()
End If
End Sub

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


BTNProses.Click
Me.TabControl1.SelectedIndex = 0
LBLT.Text = Format(TP, "###,###0")
Call ProsesPenyusutan()
End Sub
Sub ProsesJumlahProduksi()
THN = 1
Do While THN <= UA
LBLToo.Text = LBLToo.Text + Str((TA) + THN - 1) + vbCrLf
LBLJP.Text = LBLJP.Text + Format(JP(THN), "###,###0") + vbCrLf
TJP = TJP + JP(THN)
THN = THN + 1
Loop
LBLTotal.Text = Format(TJP, "###,###0")
TP = (HP - NS) / TJP
End Sub
Sub ProsesPenyusutan()
Do While Y <= UA
LBLTHN.Text = LBLTHN.Text + Str(Val(TbTA.Text) + Y - 1) + vbCrLf
LBLJPP.Text = LBLJPP.Text + Format(JP(Y), "###,###0") + vbCrLf
P = JP(Y) * TP
LBLPENYUSUTAN.Text = LBLPENYUSUTAN.Text + Format(P, "###,###0") + vbCrLf
AKP = AKP + P
LBLAKP.Text = LBLAKP.Text + Format(AKP, "###,###0") + vbCrLf
NB = HP - AKP
LBLNB.Text = LBLNB.Text + Format(NB, "###,###0") + vbCrLf
Y = Y + 1
Loop
End Sub

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


BtnHapus.Click
TbNA.Clear() : TbHP.Clear() : TbNS.Clear() : TbUA.Clear() : TbTA.Clear() :
TBP.Text = ""
LBLT.Text = "" : LBLJD.Text = "" : LBLTo.Text = "" : LBLTotal.Text = "" :
LBLToo.Text = ""
End Sub
End Class
3. OUTPUT:

You might also like