Question: Lab 2 - Loan Calculator Purpose: Write a Python program to simulate a loan calculator. Your program needs to do the following things: Ask the

Lab 2- Loan Calculator
Purpose:
Write a Python program to simulate a loan calculator. Your program needs to do the following things:
Ask the user to input three values: the principal amount of the loan, the interest rate of the loan, and the number of years on the loan. The principal amount and interest rate must be floats and the number of years must be an int.
Include a separate method that takes the principal amount, interest rate, and year to calculate the total value of the loan. The result of this calculation is returned from this method. Use the following formula to perform this calculation:
total = principal **(1+ rate )year
Keep in mind the rate must be a decimal. For example, if the user enters 5(as a percentage), this must be 0.05 in the calculation.
Use a loop starting from year 1 and going up to the year specified by the user to calculate the total value of the loan for each year. Print both the year and the loan amount formatted to two decimal places.
In general, your program will behave as follows:
Please enter the principal amount of the loan: 100000 Please enter the interest rate of the loan: 5 Please enter the number of years for the loan: 10
Year 1: $105000.00
Year 2: $110250.00
Year 3: $115762.50
Year 4: $121550.63
Year 5: $127628.16
Year 6: $134009.56
Year 7: $140710.04
Year 8: $147745.54
Year 9: $155132.82
Year 10: $162889.46
 Lab 2- Loan Calculator Purpose: Write a Python program to simulate

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!