OK so I am trying to create an application that allows the user to enter the amount a customer plans to deposit in a savings account at the end of each year, with a 10% interest rate compounded annually, an paid on the last day of each year and should display the value of the account at the end of 5, 10, 15, 20, 25, and 30 years and we can use the financial.fv method which i attempted to use. I got it to display the years but the percents all come up as 0 and i am pretty sure it is because there is something wrong with the financial.fv method. Any assistance would be greatly appreciated.
CODE
Option Explicit On
Option Strict On
Imports system.Globalization
Public Class Form1
Private Sub exitBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles exitBtn.Click
Me.Close()
End Sub
Private Sub clearBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles clearBtn.Click
paidTxtBx.Clear()
interestLbl.Text = ""
paidTxtBx.Focus()
End Sub
Private Sub calcBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles calcBtn.Click
Dim paid As Decimal
Dim interest As Decimal
Dim isconverted As Boolean
isconverted = Decimal.TryParse(paidTxtBx.Text, NumberStyles.Currency, NumberFormatInfo.CurrentInfo, _
paid)
If isconverted Then
For year As Decimal = 5D To 30D Step 5D
interest = Convert.ToDecimal(Financial.FV(0.1, year, paid, { = 0.0],[DueDate].EndOfPeriod))
interestLbl.Text = interestLbl.Text & year.ToString() & " - " & interest.ToString("C2") & ControlChars.NewLine
Next year
Else
MessageBox.Show("Please re-enter the amount paid", "Interest Calculator", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
End Class
I am not exactly sure I know what code tags are so forgive me if they are missing
thank you!!!