Write a python program that lets the user enter the loan amount and loan period in number of years. The program will then display the monthly and total payments for each interest rate starting from 4 to 8 in increments of 1.
Be sure to define a function to calculate the values and print the table displaying the interest rate in the first column, the monthly payment in the second column, and the total payment in the third column. Your program should not allow the user to enter negative amounts for the loan amount and the loan period.
Once the table has been displayed the user should be prompted as to whether they wish to enter another loan amount and loan period. Save this program as Lab4Problem1.py
Necessary formulas:
Using the pow function from the math module:
monthlyPayment = loanAmt * monthlyRate / (1 - math.pow(1 / (1 + monthlyRate), numYears * 12))
totalPayment = monthlyPayment * numYears * 12