Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Suppose that $ 1 0 0 0 is borrowed at the beginning of the year. The loan is charged interest at an annual interest rate
Suppose that $ is borrowed at the beginning of the year. The loan is charged interest at an annual interest rate of
The borrower will repay the loan by making payments of $ at the end of the year until the loan is repaid. Note that
when the final payment is made, the balance will be less than $ and so a partial payment will be made at that time.
Perform the following steps in a single code cell.
Create variables named balance, i and to store the initial loan amount, annual interest rate, and annual
payment amount mentioned in the paragraph above. Also create a variable to track the number of payments.
Use a while loop to perform the tasks described below. The loop should continue to execute for as long as the
balance of the loan is greater than
Increase the number of payments that have been made by
Calculate the new balance. This will be done by multiplying the current balance by and then
subtracting the payment amount. Store the result back into balance, rounded to decimal places.
If the new balance is less than then calculate the the final payment amount. This will be equal to the
new balance plus the payment amount. Then set the balance to
Print the message below, with the Xxxx symbols replaced with the appropriate values. Match the
format exactly.
The balance at the end of year xxxx is $xxxx
The first two lines of output should appear as shown below:
The balance at the end of year is $
The balance at the end of year is $
No lists should be created for this problem, and only one loop should be used.
Use a new code cell to print the final payment amount with a message as shown below:
The amount of the final payment will be $
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