A problem

Write a program to compute the monthly payment of principal and interest for a fixed rate mortgage.

How do we do this? A quick search of the internet yields the following formula

      P(r/n)
p = ------------
     1-(1+r/n)-nt

P the amount borrowed (principal)
p the monthly payment, principal and interest
r the annual interest rate
n the number of payments per year
t the number of years
Algorithm:
  Prompt user for principal, interest rate, years
  Compute the monthly payment
  Print the results.

Questions:
  1. Will there always be 12 monthly payments?
See this code