Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need to make a mortgage loan calculator using Microsoft visual studio in visua

ID: 656448 • Letter: I

Question

I need to make a mortgage loan calculator using Microsoft visual studio in visual basic.

I have label boxes for a loan amount, interest rate, term (in year), I also have the blan text boxes that go with them for inputting info. I have the Total amount repaid labeled with a read only text box, and a interest paid labeled with a read only text box. I feel like I have designed this all properly but I am having trouble coding it. I'm pretty much at the start of coding it but I just don't know how to go about doing this. My teacher gave us a formula   

payment = convert.todecimal(-financial.pmt(rate/12, term*12, loan)) but I have no idea what to do with this either. Please help me code this

Explanation / Answer

private void Mortgage_loan_cal()
{

//Input values

double loan_Amt = (double)txtLoanAmount.CurrentValue;   
double interest_P_Yr = (double)txtInterestPaid.CurrentValue;
double dwn_Paymnt = (double)txtDownPayment.CurrentValue;
double interest_Rate = (double)udInterest.Value / 100;   
double term_Loan = (double)(udTerm.Value * 12);
double proprty_Tax = (double)txtPropertyTax.CurrentValue;   
double insurance = (double)txtInsurance.CurrentValue;

//calculating payment
double paymnt = (loan_Amt - dwn_Paymnt) * (Math.Pow((1 + interest_Rate/12), term_Loan) * interest_Rate)/(12 * (Math.Pow((1+interest_Rate/12), term_Loan) - 1));
//use this method to calculate mortgage loan.

paymnt = paymnt + (proprty_Tax + insurance) / 12;

txtPaymnt.CurrentValue = (int)paymnt;
}