Answered step by step
Verified Expert Solution
Question
1 Approved Answer
DO NOT USE DEF STATEMENTS , MAIN , GLOBAL CODE OR VARIABLES Write a PYTHON program to ask the user to enter the amount of
DO NOT USE DEF STATEMENTS MAIN GLOBAL CODE OR VARIABLES Write a PYTHON program to ask the user to enter the amount of money they want to borrow a loan 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:
Welcome to the Consumer Loan Calculator
How much do you want to borrow? $
What is the annual interest rate expressed as a percent?
What is the monthly payment amount? $
Your debt will be paid off after months, with a final payment of just $
The total amount of interest you will pay during that time is $
Don't get overwhelmed with debt!
Welcome to the Consumer Loan Calculator
How much do you want to borrow? $
What is the annual interest rate expressed as a percent?
What is the monthly payment amount? $
You must make payments of at least $
Because your monthly interest is $
Don't get overwhelmed with debt!
Welcome to the Consumer Loan Calculator
How much do you want to borrow? $
You must enter a positive number!
How much do you want to borrow? $
You must enter a positive number!
How much do you want to borrow? $
What is the annual interest rate expressed as a percent?
You must enter a positive number!
What is the annual interest rate expressed as a percent?
What is the monthly payment amount? $
You must enter a positive number!
What is the monthly payment amount? $
Your debt will be paid off after months, with a final payment of just $
The total amount of interest you will pay during that time is $
Don't get overwhelmed with debt!
Here are the rules and some tips:
Your program must notify the user if their monthly payment isn't high enough, and tell them what the minimum payment is to pay off one month's interest and thus make progress paying off the loan
The user enters the interest rate as an annual percentage rate. You need to convert this annual percentage to a monthly decimal. For example, annual interest is per month, which is
Your program must allow only positive numbers to be entered by the user, as shown above.
This program should mimic the standard way loans work for credit cards, car loans, and home mortgages: Each month the following happens:
The balance loan amount is multiplied times the monthly interest rate to determine how much interest is owed this month. This amount of interest is added to the balance increasing the amount owed
This amount of interest is also added to the total interest so far to be output at end
The monthly payment is subtracted from the balance reducing the amount owed
The month is counted to be output at end
This is repeated each month until the loan is paid off balance reaches zero The best way to understand it is to look at an example. Let's say you borrow $ That's also called the balance or principle. Imagine your interest rate is That's an annual yearly rate, so it's per month, so you multiply the balance times to get the amount of interest. If your monthly payment is $month then here's what happens:
Month :
$ $ interest for the month
adding interest and subtracting the payment:
$ $ $ $ new balance
Month :
$ $ interest for the month
adding interest and subtracting the payment:
$ $ $ $ new balance
Month :
$ $ interest for the month
adding interest and subtracting the payment:
$ $ $$ new balance
Since the new balance is negative, the loan is paid off, and the final payment is too much. It should have been $ $ $ final payment, formatted to display as $
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started