' Project Mortgage1 ' Inputs: p (principal) ' r (yearly interest rate in percent) ' n (duration of loan) ' Output: m (monthly payment) Imports System.Console Public Module Module1 Public Sub Main() Dim n As Integer Dim p, r, m As Double ' Enter inputs with prompt for each. Write("Enter principal: ") p = ReadLine() Write("Enter interest rate in percent: ") r = ReadLine() Write("Enter duration of loan: ") n = ReadLine() ' Calculate monthly payment. m = (p * r / 1200) / (1 - (1 + r / 1200) ^ (-12 * n)) ' Output monthly payment. WriteLine("Monthly payment is " & m & ".") ReadLine() End Sub End Module