我的表格应该让某人在直线折旧和双倍折旧余额折旧之间进行选择。直线,我已经想通了,但由于某种原因,我无法让Double-Decline工作。基本上,用户输入项目的年份,成本和预计使用期限,程序向他们显示该项目的年度折旧。折旧计算
所以如果该项目是从2013年开始,花费$ 1000,并且有4年的预期寿命我想输出的样子:在2013年初 价值:$ 1000个 2013年折旧ammount的:$ 500(这是成本的50%) 在2013年年底的总折旧:在2014年初$ 500强
价值:$ 500(成本 - 以前的折旧)听英语过程中的折旧 ammount的:$ 250(这是新的50%价值) 2014年底的折旧总额:750美元(这是从今年起的最后一次折旧)
值在2015年开始:(同上。)$ 250 2015期间折旧的 金额:$ 125(新值的50%) 在2015年底总折旧:(同上)$ 857
等。等等,等等
,所以我会附上只是一段代码,我觉得是给我的问题:
Private Sub btnDouble_Click(sender As Object, e As EventArgs) Handles btnDouble.Click
lstResults.Items.Clear()
lstResults.Items.Add("Description: " & txtItem.Text)
lstResults.Items.Add("Year of Purchase: " & txtYear.Text)
lstResults.Items.Add("Cost: " & FormatCurrency(txtCost.Text))
lstResults.Items.Add("Estimated life: " & txtLife.Text)
lstResults.Items.Add("Method of Depreciation: Double-Declining-Balance Method")
lstResults.Items.Add(" ")
doubleDecline(CInt(txtYear.Text), CInt(txtCost.Text), CInt(txtLife.Text))
End Sub
Sub doubleDecline(year As Integer, cost As Integer, life As Integer)
Dim depreciation As Integer = cost * 0.5
Dim totalDepreciation As Integer = depreciation
While (cost > 0)
lstResults.Items.Add("Value at Beginning of " & year & ": " & vbTab & vbTab & FormatCurrency(cost))
lstResults.Items.Add("Ammount of depreciation during " & year & ": " & vbTab & FormatCurrency(depreciation))
lstResults.Items.Add("Total depreciation at the end of " & year & ": " & vbTab & FormatCurrency(totalDepreciation))
lstResults.Items.Add(" ")
year += 1
cost -= depreciation
totalDepreciation += depreciation
End While
End Sub
无论出于何种原因,折旧每年都保持不变,并且不每次减少50%,我不知道该做什么。任何帮助或方向表示赞赏!谢谢!
您在计算中似乎没有使用“life”的值。 –