Please use code tags when posting code. Code tags make it easer to read and comment on your code.
http://www.cplusplus.com/articles/jEywvCM9/
OK, you wrote the input part of your program.
The problem statement talks about calculating interest and subracting the payment every month (or monthly-compounded interest). Part of your line 14 attempts to do this calculation, but it does it wrong and only does it once.
Re-read your problem statement. Nowhere does it say to divide the loan amount by anything. Also, I would change the variable names
yearly_intrest
and
monthly_intrest
to
yearly_rate
and
monthly_rate
. You will be calculating interest every month, and you don't want to confuse the interest rate with the calculate interest amount.
Start slowly and do this one step at a time. After you have read in the input (that part looks ok, except you might want to verify that all the values are positive), print out just the monthly interest rate, the first month's interest amount, and the remaining principle after the first month's payment. Also print out whether the first month's interest amount is greater than the monthly payment.
After you have completed this step, add in a loop to do this 2 times. Test it with the sample data in the problem statement and make sure you are getting what you expect.
Next, Add a check in your loop to determine whether your error condition is met. If it is, print the warning and break out of the loop
Last, Change the loop to keep going until the load is repaid. Instead of printing out the info, count the number of iterations. Print out the total after you leave the loop.
At each step, if you have problems, come back here, tell us what your struggles are, and ask questions. A specific question will get you good help. Simply pasting code without any context (like you did in your previous post) will likely get ignored by many on this board because we don't know what you need help with. So far you've posted twice on this thread and still haven't asked a question or mentioned what you are struggling with.
Information on looping:
http://www.cplusplus.com/doc/tutorial/control/
(look for "Iteration statements (loops)")