You are on page 1of 2

Nama : M Arif Rahman

Nim : 2005151018
Kls : AKP-6A

1. Design

2. Coding

Public Class Form1


' Nama Projek : Tugas-3
' Tanggal : 05-04-2023
' Oleh : M Arif Rahman
' Ket : Penyusutan Aktiva Tetap Metode Garis Lurus
'-----------------------------------------------------------------------------------'

Dim Hal, Umur, TA, Tahun As Integer


Dim HP, NS, SalAwal, Peny, AkumP, SalAkhir As Long

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


Hal = Hal + 1
LblHal.Text = Str(Hal)
End Sub

Private Sub BtnProses_Click(sender As Object, e As EventArgs) Handles BTNPROSES.Click


Umur = Val(TbUA.Text) : Tahun = Val(LblT.Text) : HP = Val(TbHp.Text)
NS = Val(TbNS.Text) : Peny = Val(LblP.Text) : AkumP = Val(LblAP.Text)
Tahun = 1
Peny = (HP - NS) / Umur
AkumP = Peny + 0
SalAwal = HP - 0
SalAkhir = HP - Peny

Do While Tahun <= Umur


LBLT.Text = LBLT.Text + Str(Tahun) + vbCrLf
LblP.Text = LblP.Text + Str(Peny) + vbCrLf
Nama : M Arif Rahman
Nim : 2005151018
Kls : AKP-6A

LblAP.Text = LblAP.Text + Str(AkumP) + vbCrLf


AkumP = AkumP + Peny
LBLSA.Text = LBLSA.Text + Str(SalAwal) + vbCrLf
SalAwal = SalAwal - Peny
LBLSAK.Text = LBLSAK.Text + Str(SalAkhir) + vbCrLf
SalAkhir = SalAkhir - Peny
Tahun = Tahun + 1

If Tahun Mod 11 = 0 Then


MsgBox("Klik OK!", MsgBoxStyle.Information, "Informasi")
LBLT.Text = "" : LBLSA.Text = "" : LBLP.Text = "" : LBLAP.Text = "" :
LBLSAK.Text = ""
Hal = Hal + 1
LblHal.Text = Str(Hal)
End If
Loop
End Sub

Private Sub BTNHAPUS_Click(sender As Object, e As EventArgs) Handles BTNHAPUS.Click


LBLT.Text = "" : LBLSA.Text = "" : LBLP.Text = "" : LBLAP.Text = "" : LBLSAK.Text
= ""
TBNA.Clear() : TBHP.Clear() : TBNS.Clear() : TBUA.Clear() : TBNA.Focus()
End Sub

End Class

3. Output

You might also like