This document declares variables to store integer values for inputs and calculations in a production and depreciation program. It includes subroutines to get user input, calculate total production, depreciation amounts, and net book value over multiple years. The subroutines output results to labels on the form. A clear button is also included to reset the form fields.
This document declares variables to store integer values for inputs and calculations in a production and depreciation program. It includes subroutines to get user input, calculate total production, depreciation amounts, and net book value over multiple years. The subroutines output results to labels on the form. A clear button is also included to reset the form fields.
This document declares variables to store integer values for inputs and calculations in a production and depreciation program. It includes subroutines to get user input, calculate total production, depreciation amounts, and net book value over multiple years. The subroutines output results to labels on the form. A clear button is also included to reset the form fields.
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 BtnInputP_Click(sender As Object, e As EventArgs) Handles BtnInputP.Click
Me.TabControl1.SelectedIndex = 1 HP = Val(TbHP.Text) NS = Val(TbNS.Text) UA = Val(TbUA.Text) TA = Val(TbTA.Text) LblJD.Text = UA LblThn.Text = TA
End Sub
Private Sub BtnInputJP_Click(sender As Object, e As EventArgs) Handles
BtnInputJP.Click JP(X) = Val(TbJlhP.Text) If X < UA Then X = X + 1 TbJlhP.Clear() : TbJlhP.Focus() Else TbJlhP.Enabled = False BtnInputP.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 LblTf.Text = Format(TP, "###,##0") Call ProsesPenyusutan() End Sub Sub ProsesJumlahProduksi() Thn = 1 Do While Thn <= UA LblTho.Text = LblTho.Text + Str((TA) + Thn - 1) + vbCrLf LblJlP.Text = LblJlP.Text + Format(JP(Thn), "###,##0") + vbCrLf TJP = TJP + JP(Thn) Thn = Thn + 1 Loop LblTTl.Text = Format(TJP, "###,##0") TP = (HP - NS) / TJP End Sub Sub ProsesPenyusutan() Do While Y <= UA LblT.Text = LblT.Text + Str(Val(TbTA.Text) + Y - 1) + vbCrLf LblJP.Text = LblJP.Text + Format(JP(Y), "###,##0") + vbCrLf P = JP(Y) * TP LblP.Text = LblP.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