I need help with this assignment I do not know what im doing wrong.
Write a program that accepts as input:
The loan amount
The interest rate per year
The monthly payment.
(Enter the interest rate as a percentage. For example, if the interest rate is 7.2% per year, then enter 7.2.)
The program then outputs the number of months it would take to repay the loan.
(Note that if the monthly payment is less than the first month’s interest, then after each payment, the loan amount will increase.)
In this case, the program must warn the borrower that the Monthly payment is too low. The loan cannot be repaid.
I think that one of the loops is incorrect because when I run it it skips line 18 and runs my first loop until it crashes. Other than that I don't know what is wrong with it.
> it skips line 18
line 18: cout << "Enter your monthly payment: " << endl;
¿that line doesn't print to screen?
¿or is the next line cin >> payment; the one that doesn't execute?
¿what's your input?
> runs my first loop until it crashes
¿what exactly do you mean by crash?
¿does the program terminate? ¿freeze? ¿prints a lot of garbage?
It doesn't print line 18, but I was able to fix it. The main problem revolved around the interest rate, but @lastchance helped me with that. Thank you to all that helped.