Welcome to Dream.In.Code
Become a VB Expert!

Join 137,234 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,645 people online right now. Registration is fast and FREE... Join Now!




Financial.FV method problems

 
Reply to this topicStart new topic

Financial.FV method problems, Edmonton Bank Page 348 if you have the book, I am kind of stuck

cna6cander3
19 Mar, 2007 - 08:14 PM
Post #1

New D.I.C Head
*

Joined: 19 Mar, 2007
Posts: 2


My Contributions
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 rolleyes.gif

thank you!!!
User is offlineProfile CardPM
+Quote Post

Jayman
RE: Financial.FV Method Problems
19 Mar, 2007 - 09:41 PM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 6,985



Thanked: 44 times
Dream Kudos: 500
Expert In: C#, VB.NET, Java

My Contributions
Yes, it looks like you have a problem with your call to Financial.FV. Should look like this:
CODE
interest = Convert.ToDecimal(Financial.FV(0.1, year, -paid, 0.0 ,[DueDate].EndOfPeriod))


User is online!Profile CardPM
+Quote Post

cna6cander3
RE: Financial.FV Method Problems
20 Mar, 2007 - 06:54 PM
Post #3

New D.I.C Head
*

Joined: 19 Mar, 2007
Posts: 2


My Contributions
Dude I love you! Thank you soooo much, it totally worked!!! smile.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/4/08 04:00PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month