Need tutor

I need a tutor to help me with a program for a class project.  I am at stuck at step 9 in the instructions.  If possible, Program Sharing in MSN Messenger would be most efficient, but if you have a way to talk me through this in the forum that will be okay also.  I have a couple of open questions about this project in this EE category already, and I will award points from those open question to whomever can help me get this app running as specified below.

Here is what my app currently looks like:

1.) Write a VB.NET program using a graphical user interface
2.) Calculates and display the mortgage payment amount from user input of the amount of the mortgage, the term of the
mortgage, and the interest rate of the mortgage.  
3.) Allow the user to loop back and enter new data or quit.  
4.) Modify the mortgage program to allow the user to input the amount of a mortgage and then select from a menu of mortgage loans: 7 year at 5.35%, 15 year at 5.5 %, and 30 year at 5.75%.  
5.) Use an array for the different loans.  
6.) Display the mortgage payment amount.  
7.) Then, list the loan balance and interest paid for each payment over the term of the loan.  
8.) Allow the user to loop back and enter a new amount and make a new selection, or quit.  
9.) Modify the mortgage program to allow the user to select which way they want to calculate a mortgage: by input of the
amount of the mortgage, the term of the mortgage, and the interest rate of the mortgage payment (as was done in the Step 2) or by input of the amount of a mortgage and then select from a menu of mortgage loans: 7 year at 5.35%, 15 year
at 5.5 %, and 30 year at 5.75% (as was done in Step 3).  
10.) In either case, display the mortgage payment amount.  
11.) Then, list the loan balance and interest paid for each payment over the term of the loan.  
12.) Allow the user to loop back and enter a new amount and make a new selection, or quit.  
13.) Load the interest rates for the 7 year, 15 year, and 30 year loans from a file.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
Look at a combination RadioButtons and TextBoxes.

gmahler5thAuthor Commented:
I understand what you are saying Bob, but I don't know how to tie all the logic together once I get the radio buttons on the page.  
Bob LearnedCommented:
Have you added the RadioButtons, such as:

Calculation method:
( ) By amount, term, and interest rate
( ) By amount and selected loan

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

gmahler5thAuthor Commented:
No i was thinking i would use tabs to allow the user to select which method to calculate the loan.  I guess you are suggesting radio buttons would be easier?
Bob LearnedCommented:
I am not a big fan of tabs--they hide functionality.  Although, tabs start to make sense when there are a lot of controls, but if that is true, then I try to evaluate why there are so many and redistribute to different forms.  It's all about personal preference, though.  While learning something new, you should experiment with it both ways and see which way you like best.  Just because I feel one way doesn't mean that you have to.

gmahler5thAuthor Commented:
Actually I'm stuck at step 4.  

I can't quite visualize the UI if I keep it all on the same form using radio buttons.

Can you provide any suggestions?
gmahler5thAuthor Commented:
Okay I finally have a UI that meets the requirements. (Step 4 and Step 9)

Now I need to build in the logic to display the payment for steps 5/6/10.  My form code can be seen at the following URL

Can someone please help me with the code for steps 5, 6, 10, 11 and 13?
Bob LearnedCommented:
Second lesson:

Learn early that code in the form control's event sink is generally poor practice.  Put that code in a class (Study the Model-View-Controller pattern).

Third lesson:

Create a method that will calculate the mortgage based on parameters defined from the form so that you set up.

gmahler5thAuthor Commented:
I am stuck on steps 9 and 13 now.  Alllowing the user to choose which calculation method they want to use... and using an array to calculate from predefined rates... and loading the predefined rates from a file...

Someone please help?
   'declare your variables here
    Dim iRates As New Rates

    Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
        Dim Fmt As String
        Dim TotPmts As Integer
        Dim PVal, APR, FVal, Payment, dblMonth, dblRateMonth As Double

        'assign the values from textboxes to the variables
        If CT1.Checked = True Then ' Choose own rates
            APR = Convert.ToDouble(txtRate.Text)
            TotPmts = Convert.ToInt32(txtYears.Text)
        ElseIf CT2.Checked = True Then ' Predefined
            If PDR1.Checked = True Then
                APR = iRates.Item(0).Num2
                TotPmts = Convert.ToInt32(iRates.Item(0).Num1)
            ElseIf PDR2.Checked = True Then
                APR = iRates.Item(1).Num2
                TotPmts = Convert.ToInt32(iRates.Item(1).Num1)
            ElseIf PDR3.Checked = True Then
                APR = iRates.Item(2).Num2
                TotPmts = Convert.ToInt32(iRates.Item(2).Num1)
            End If
        End If

        PVal = Convert.ToDouble(txtPrincipal.Text)
        TotPmts = TotPmts * 12

        If APR > 1 Then APR = APR / 100 ' Ensure proper form.
        dblMonth = TotPmts * 12
        dblRateMonth = APR / 12

        'calculate the final amount as principal + interest
        Fmt = "###,###,##0.00"   ' Define money format.
        FVal = 0   ' Usually 0 for a loan.
        Payment = PVal / ((1 - (1 + dblRateMonth) ^ -dblMonth) / dblRateMonth)

        'put the calculated amount in Payment Amount textbox
        txtAmount.Text = FormatNumber(Payment, 2, TriState.True, TriState.True, TriState.False)


        Dim objDT As New DataTable
        objDT.Columns.Add("Month", GetType(Integer))
        objDT.Columns.Add("Balance", GetType(Double))
        objDT.Columns.Add("Installment", GetType(Double))
        objDT.Columns.Add("Interest Paid", GetType(Double))
        objDT.Columns.Add("Principal Paid", GetType(Double))

        MyBase.Height = 536

        Dim balanceLeft As Double = PVal '- downPayment
        Dim interestPaid As Double
        Dim LoanDuration As Integer = TotPmts '* 12

        For i As Integer = 1 To LoanDuration
            Dim strRow(4) As Object

            interestPaid = balanceLeft * APR / 100 / 12
            balanceLeft = balanceLeft + interestPaid - Payment

            strRow(0) = i
            strRow(1) = Convert.ToDouble(FormatNumber(balanceLeft, 2))
            strRow(2) = Convert.ToDouble(FormatNumber(Payment, 2))
            strRow(3) = Convert.ToDouble(FormatNumber(interestPaid, 2))
            strRow(4) = Convert.ToDouble(FormatNumber(interestPaid - Payment, 2))

            'al.Add(New repayment(i, balanceLeft, monthlyInstallment, interestPaid, interestPaid - monthlyInstallment))


        Me.dgAmortization.DataSource = objDT
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim oFile As System.IO.File
        Dim oRead As System.IO.StreamReader
        Dim strLine As String
        Dim isEnd As Boolean = False
        Dim strRegExp As String = "PDR(?:\[|\()(?<Seq>\d{1})(?:\]|\))\s\((?<Num1>\d+)(?:,|\.)(?<Num2>[0-9\.]+)\)"

        oRead = oFile.OpenText("C:\rates.txt")
        Do While isEnd = False
            If oRead.Peek = -1 Then
                isEnd = True
                Exit Do
            End If
            strLine = oRead.ReadLine

            Dim iMatch As Match = Regex.Match(strLine, strRegExp)

            'MsgBox(iMatch.Groups("").Value.ToString & ":" & iMatch.Groups(1).Value.ToString & ":" & iMatch.Groups(2).Value.ToString)
            Dim seq As Integer = Convert.ToInt32(iMatch.Groups("Seq").Value.ToString)
            Dim num1 As Double = Convert.ToInt32(iMatch.Groups("Num1").Value.ToString)
            Dim num2 As Double = Convert.ToDouble(iMatch.Groups("Num2").Value)

            Dim iRate As New Rate(seq, num1, num2)
            Select Case seq
                Case 0
                    Me.PDR1.Text = num1 & " Years " & num2 & "%"
                Case 1
                    Me.PDR2.Text = num1 & " Years " & num2 & "%"
                Case 2
                    Me.PDR3.Text = num1 & " Years " & num2 & "%"
            End Select
    End Sub

    Public Class Rates
        Inherits CollectionBase

        Public Sub add(ByVal r As Rate)
        End Sub

        Public Overloads Function Item(ByVal Index As Integer) As Rate
            ' To retrieve an item from the InnerList, pass the index of that item to the .Item property.
            Return CType(Me.InnerList.Item(Index), Rate)
        End Function

        Public Overloads Sub Remove(ByVal Index As Integer)
            ' This Remove expects an index.
            Dim iRate As Rate
            iRate = CType(Me.InnerList.Item(Index), Rate)
            If Not iRate Is Nothing Then
            End If
        End Sub
    End Class

    Public Class Rate
        Public Seq As Integer
        Public Num1 As Double
        Public Num2 As Double

        Public Sub New(ByVal oseq As Integer, ByVal onum1 As Double, ByVal onum2 As Double)
            Me.Seq = oseq
            Me.Num1 = onum1
            Me.Num2 = onum2
        End Sub
    End Class
End Class

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.