Apart from a missing '(' in the denominator, the formula is correct.

Unfortunately, in this form the formula is unrecognizable and

impossible to decipher and remember.

In this topic:

https://coderanch.com/t/624366/java/java/Writing-formula-Java
I give a much simpler to remember form, including a derivation.

The í' is simply the annual interest rate. What happens here, implicitly, is

that we are dealing with a normal annuity loan, where the annual payment

is calculated, given the duration n, the face value p of the loan, and in annual

interest rate i.

So, in fact, the outcome would be that you pay back the whole loan if you do

just one payment, at the end of every year t (t = 1, 2, ..., n).

But these bankmen then divide the year payment by 12, and let you pay

that amount every month. In effect, you then have a real interest rate that

is slightly more than the communicated interest rate 'i'. Hmm... not nice,

but standard practise.

That's where the '12' in the denominator is coming from.

After this long introduction

the monthly payment can be calculated with the given horrible formula,

but taking as loan (the 'p' in the formula) the price of the house minus the

down payment. Well, I just had a look up of what 'down payment' is via

Google Translate, and it is the initial payment, the part of the house price that you

pay with own money. Correct me if I'm wrong here.

The monthly utility expenses are input.

The interest rate should also be input, somewhere. Strange that it is not mentioned

in the exercise.

Finally, the last question is a bit strange. Are you supposed to simply

add up the total monthly payments, for as long as the loan is not

fully repaid? Or are you supposed to calculate the so called present value

of all these payments? Is that given somewhere in the text book?

Greetz,

Piet