compute loan?

jjstarr

New member
Joined
Mar 8, 2011
Messages
2
Programming Experience
Beginner
Hi I have no club about this VB stuff I am being asked to do this
Dim Loan, Air, Duration As Double
Dim msg As String
txtCompute.Clear()
msg =
"Your loan is bunk"
Loan = CDbl(txtLoan.Text)
Air =
CDbl(txtAir.Text)
Duration =
CDbl(txtDuration.Text)
txtCompute.Text = ((Loan * (Air / 12)) / (1 - (1 + Loan) ^ (-Duration)))

PLEASE HELP
 
You might want to elaborate on what your question/problem actually is - there are some very skilled folk using this forum, but even they can't provide something from nothing.
 
Sorry about that

You might want to elaborate on what your question/problem actually is - there are some very skilled folk using this forum, but even they can't provide something from nothing.
This is the problem, and what you saw in my last post was how far I got.

Write a program to analyze a mortgage. The user should enter the amount of the loan, the annual rate of interest and the duration of the loan in months. When the user clicks on the button the information that was entered should be checked to make sure it is reasonable. If bad data have been supplied the user should be so advised. Otherwise the monthly payment and the total amount of interest paid should be displayed. The formula for monthly payment is (payment=p*r/(1-(1+r) v(-n) ), where p is the amount of the loan r is the monthly interest rate (annual rate divided by 12) given as a number between 0 (for 0 percent) and 1 (for 100 percent) and n is the duration of the loan in months. the formula for the total interest paid is (total interest=n* payment-p) (Test the program for a mortgage of $240,000 at 6% annual rate of interest, and duration 360 months. Such a mortgage will have a monthly payment of $1,438.92 and total interest of $278,011.65
 
p*r/(1-(1+r) v(-n)
((Loan * (Air / 12)) / (1 - (1 + Loan) ^ (-Duration)))
Those formulas are not consistent. Substitute you letter or your names in either one and you'll see. Hint, one place you have Loan=p, another Loan=r.
I have not gone to any further length to validate which is what, just saying that they are not the same. It may be a good idea to use same names in formula and in code variables.
 
I am in kinda the same boat with jj. No offense but I dont want to program , but was the only class available til more opened up in the Fall semester.
I have the same question but my code is different from jj's
VB.NET:
 Dim Amount As Integer = txtAmount.Text
        Dim Rate As Integer = txtRate.Text
        Dim Months As Integer = txtMonths.Text
        Dim Payment As Integer = txtPayment.Text
        Dim Total As Integer = Total = txtTotal.Text
        Payment = (txtAmount.Text * txtRate.Text / (1 - (1 + txtRate.Text) ^ (-txtMonths.Text)))
        txtTotal.Text = txtPayment.Text * txtMonths.Text - txtAmount.Text

I have no idea where to start , I am completely lost in class and there are no tutors available . The teacher has class after ours so I cant stay after to attempt to get help , teacher shows up 5 minutes before class . I am not asking for the answer but a point in the right direction .
 
Back
Top