本文整理汇总了VB.NET中Microsoft.VisualBasic.Financial.SLN方法的典型用法代码示例。如果您正苦于以下问题:VB.NET Financial.SLN方法的具体用法?VB.NET Financial.SLN怎么用?VB.NET Financial.SLN使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.VisualBasic.Financial
的用法示例。
在下文中一共展示了Financial.SLN方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: CDbl
Dim InitCost, SalvageVal, LifeTime, DepYear As Double
Dim Fmt As String = "###,##0.00"
InitCost = CDbl(InputBox("What's the initial cost of the asset?"))
SalvageVal = CDbl(InputBox("Enter the asset's value at end of its life."))
LifeTime = CDbl(InputBox("What's the asset's useful life in years?"))
' Use the SLN function to calculate the deprecation per year.
Dim SlnDepr As Double = SLN(InitCost, SalvageVal, LifeTime)
Dim msg As String = "The depreciation per year: " & Format(SlnDepr, Fmt)
msg &= vbCrLf & "Year" & vbTab & "Linear" & vbTab & "Doubling" & vbCrLf
' Use the SYD and DDB functions to calculate the deprecation for each year.
For DepYear = 1 To LifeTime
msg &= DepYear & vbTab &
Format(SYD(InitCost, SalvageVal, LifeTime, DepYear), Fmt) & vbTab &
Format(DDB(InitCost, SalvageVal, LifeTime, DepYear), Fmt) & vbCrLf
Next
MsgBox(msg)