Reference no: EM132178405
This is for Visual Studios 2015
Create a form using While and For loop with textbox to enter loan amount, term of the loan in year, starting annual rate, ending annual rate and rate step value, then use the Visual Basic's Pmt function to compute the payment for each rate and display the monthly payments in a listbox.
I've gotten this far for using "while" and when entering in the information, I get the same payment. There is something wrong with the calculations and I do not know what i'm missing.
double loan, term, startRate, endRate, stepValue, payment, rate;
loan = double.Parse(textBox1.Text);
term = double.Parse(textBox2.Text);
startRate = double.Parse(textBox3.Text);
endRate = double.Parse(textBox4.Text);
stepValue = double.Parse(textBox5.Text);
rate = startRate;
listBox1.Items.Clear();
while(rate<=endRate)
{
payment = Financial.Pmt((startRate / 100) / 12,term*12,-loan);
listBox1.Items.Add("Rate="+rate.ToString("p") + " Payment is: "
+ payment.ToString("c"));
rate += stepValue;