deathspawner
New member
- Joined
- Feb 12, 2005
- Messages
- 1
- Programming Experience
- Beginner
Have this problem to solve in an exam, but no matter how much I try, I cannot figure it out. Here is a code snippet
I am sure you could tell what's going on through the code.. but the problem is.. it will spit out the values all the same. It won't work the way it's supposed to.
It's supposed to depreciate the value of owing over time, but it's not carrying over the values as I'd like. Also, for some values, it spits out a False.. and I can't figure that out.
Sorry if I left out some details, please let me know what I forgot to mention.
Thanks for any help!
VB.NET:
If radStraight.Checked Then
Dim frmStr As String = "{0, -10} {1,12} {2,14} {3,12}"
Dim x As Integer = 0
Deprec = (1 / Life) * Cost
For i = 0 To Life - 1
Line = ((Year + i) & (Cost - TotalDeprec) & Deprec & (TotalDeprec + Deprec))
lstSchedule.Items.Add(String.Format(frmStr, "test", "test", "test", "test"))
lstSchedule.Items.Add(String.Format(frmStr, Year + i, Year + i, Year + i, Year + i))
lstSchedule.Items.Add(String.Format(frmStr, (x), (Cost - TotalDeprec), (Cost - TotalDeprec), (Cost - TotalDeprec)))
lstSchedule.Items.Add(String.Format(frmStr, Deprec, Deprec, Deprec, Deprec))
lstSchedule.Items.Add(String.Format(frmStr, TotalDeprec = TotalDeprec + Deprec, TotalDeprec = TotalDeprec + Deprec, TotalDeprec = TotalDeprec + Deprec, TotalDeprec = TotalDeprec + Deprec))
Next i
I am sure you could tell what's going on through the code.. but the problem is.. it will spit out the values all the same. It won't work the way it's supposed to.
It's supposed to depreciate the value of owing over time, but it's not carrying over the values as I'd like. Also, for some values, it spits out a False.. and I can't figure that out.
Sorry if I left out some details, please let me know what I forgot to mention.
Thanks for any help!