Question: Code is written in Python. The credit plan at TidBit Computer Store specifies a 10% down payment and an annual interest rate of 12%. Monthly

Code is written in Python. The credit plan at TidBit Computer Store specifies a 10% down payment and an annual interest rate of 12%. Monthly payments are 5% of the listed purchase price, minus the down payment.

Write a program that takes the purchase price as input. The program should display a table, with appropriate headers, of a payment schedule for the lifetime of the loan. Each row of the table should contain the following items:

  1. The month number (beginning with 1)
  2. The current total balance owed
  3. The interest owed for that month
  4. The amount of principal owed for that month
  5. The payment for that month
  6. The balance remaining after payment

The amount of interest for a month is equal to balance rate / 12.

The amount of principal for a month is equal to the monthly payment minus the interest owed.

An example of the program input and output is shown below:

Enter the puchase price: 200 Month Starting Balance Interest to Pay Principal to Pay Payment Ending Balance 1 180.00 1.80 7.20 9.00 172.80 2 172.80 1.73 7.27 9.00 165.53 3 165.53 1.66 7.34 9.00 158.18 4 158.18 1.58 7.42 9.00 150.77 5 150.77 1.51 7.49 9.00 143.27 6 143.27 1.43 7.57 9.00 135.71 7 135.71 1.36 7.64 9.00 128.06 8 128.06 1.28 7.72 9.00 120.34 9 120.34 1.20 7.80 9.00 112.55 10 112.55 1.13 7.87 9.00 104.67 11 104.67 1.05 7.95 9.00 96.72 12 96.72 0.97 8.03 9.00 88.69 13 88.69 0.89 8.11 9.00 80.57 14 80.57 0.81 8.19 9.00 72.38 15 72.38 0.72 8.28 9.00 64.10 16 64.10 0.64 8.36 9.00 55.74 17 55.74 0.56 8.44 9.00 47.30 18 47.30 0.47 8.53 9.00 38.77 19 38.77 0.39 8.61 9.00 30.16 20 30.16 0.30 8.70 9.00 21.46 21 21.46 0.21 8.79 9.00 12.68 22 12.68 0.13 8.87 9.00 3.80 23 3.80 0.00 3.80 3.80 0.00

This is the code I have so far but my output is off:

price = float(input('Enter the purchase price: '))

downPay = (price * .10)

month = 1

StaringBalance = (price - downPay)

annualInterestRate = 0.12

payment = (price - downPay) *.05

#Display the header of the table.

print(' Month Starting Balance Interest to Pay '\

'Principal to Pay Payment Ending Balance')

#Start a while loop till the initiali balnace is greater

#than or equal to the montly payment.

while StaringBalance >= payment:

#Calculate the interest paid for the current month by

#multiplying the current price with

#annualInterestRate/12.

interest = StaringBalance * annualInterestRate / 12

#Calculate the principal amount by subtracting the

#amount of interest from monthly payment.

principal = payment - interest

#Calculate the monthly payment by adding the amount of

#interest with principal amount.

payment = principal + interest

#Calculate the ending balance by subtracting the

#monthly payment from starting balance.

endingBalance = StaringBalance - payment

#Display the row of the table showing required

#information.

print('{:

'{:

'{:

'{:

'{:

format("{:6.2f}".format(endingBalance)))

#Make the ending balance new starting balance.

StaringBalance = endingBalance

#Increment the value of the variable month.

month += 1

Code is written in Python. The credit plan at TidBit Computer Store

>- Terminal + Enter the purchase price: 200 Month 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Starting Balance Interest to Pay Principal to Pay Payment Ending Balance 180.00 1.80 7.20 9.00 171.00 171.00 1.71 7.29 9.00 162.00 162.00 1.62 7.38 9.00 153.00 153.00 1.53 7.47 9.00 144.00 144.00 1.44 7.56 9.00 135.00 135.00 1.35 7.65 9.00 126.00 126.00 1.26 7.74 9.00 117.00 117.00 1.17 7.83 9.00 108.00 108.00 1.08 7.92 9.00 99.00 99.00 0.99 8.01 9.00 90.00 90.00 0.90 8.10 9.00 81.00 81.00 0.81 8.19 9.00 72.00 72.00 0.72 8.28 9.00 63.00 63.00 0.63 8.37 9.00 54.00 54.00 0.54 8.46 9.00 45.00 45.00 0.45 8.55 9.00 36.00 36.00 0.36 8.64 9.00 27.00 27.00 0.27 8.73 9.00 18.00 18.00 0.18 8.82 9.00 9.00 9.00 0.09 8.91 9.00 0.00 >

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!