Homework 8: Consumer Loan Program

Objective: To calculate how long it will take to pay off a loan.

Your program will ask the user to enter the amount of money they want to borrow, the interest rate, and the monthly payment amount. Your program will then determine how many months it will take to pay off that loan, what the final payment amount will be, and how much interest was paid over that time. If the monthly payment amount isn't high enough to pay off more than one month's interest, your program should notify the user what the minimum monthly payment is.

Here are some examples of how your program should behave. Please use the exact same test cases as these, so that we can verify that your program works:

[cpersiko@fog cs110a]$ python3 consumerLoan.py 
** Welcome to the Consumer Loan Calculator **
How much do you want to borrow? $1000
What is the annual interest rate expressed as a percent? 18
What is the monthly payment amount? $50
Your debt will be paid off after 24 months, with a final payment of just $47.83
The total amount of interest you will pay during that time is $197.83
** Don't get overwhelmed with debt! **

[cpersiko@fog cs110a]$ python3 consumerLoan.py 
** Welcome to the Consumer Loan Calculator **
How much do you want to borrow? $15000
What is the annual interest rate expressed as a percent? 10
What is the monthly payment amount? $100
You must make payments of at least $126.00
Because your monthly interest is $125.00
** Don't get overwhelmed with debt! **

[cpersiko@fog cs110a]$ python3 consumerLoan.py 
** Welcome to the Consumer Loan Calculator **
How much do you want to borrow? $-50
You must enter a positive number!
How much do you want to borrow? $-200
You must enter a positive number!
How much do you want to borrow? $20000
What is the annual interest rate expressed as a percent? -2.5
You must enter a positive number!
What is the annual interest rate expressed as a percent? 5
What is the monthly payment amount? $0
You must enter a positive number!
What is the monthly payment amount? $200
Your debt will be paid off after 130 months, with a final payment of just $125.79
The total amount of interest you will pay during that time is $5925.79
** Don't get overwhelmed with debt! **
[cpersiko@fog cs110a]$ 

Here are the rules and some tips: