Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a python function called calcMonthlyPmt that accepts THREE parameters (interest rate, loan amount and number of years) and should return the monthly payment.

1. Write a python function called calcMonthlyPmt that accepts THREE parameters (interest rate, loan amount and number of years) and should return the monthly payment.

Use this formula to calculate the monthly payment: ratePerMonth * loanAmount

1 (1 + ratePerMonth) numMonths

NOTE: there should be NO input or print statements in this function!

2. Write another function called calcTotalPmts. It should accept TWO parameters (monthlyPmt and number of months) and should return the total amount paid for the loan. NOTE: there should be NO input or print statements in this function!

3. In the main program, ask the user to enter these values at the beginning of the program.

Loan amount

Loan period (# of years)

Use a loop to display the results using a series of different interest rates.The loop should allow the interest rate to range from 5% up to and including 8%.Increment the interest rate by 1/8 each time through the loop. Each time through your loop, you should call your two functions to calculate the monthly and total payments, and print a line that displays these 3 values:

Interest Rate (formatted to display exactly 3 digits to the right of the decimal)

Monthly payment (formatted to display exactly 2 digits to the right of the decimal)

Total payment (formatted to display exactly 2 digits to the right of the decimal) Remember to include headings AND the underlining beneath the headings. Here is a sample run:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Aided Database Design

Authors: Antonio Albano, Valeria De Antonellis, A. Di Leva

1st Edition

0444877355, 978-0444877352

More Books

Students also viewed these Databases questions

Question

LO2 Identify components of workflow analysis.

Answered: 1 week ago