Question

reate a purchase-finance program that asks for a purchase price, requires a 10% down payment, and...

reate a purchase-finance program that asks for a purchase price, requires a 10% down payment, and a 5% (of purchase price) payment per month. Print out a table that shows payment number, balance before payment, payment, interest and principal include in the payment and balance after payment. Use formatting so that all fields (Columns) align and are rounded to two decimal places. Python programming

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Python code

purchaseprice = float(input("Enter purchase price: "))
downpayment = 0.1 * purchaseprice
paymentpermonth = 0.05 * purchaseprice
ispaymentcomplete = False
paymentnumber = 0
interestpermonth = 0.01
totalmonths = (100-10)/5
balancebeforepayment = purchaseprice + interestpermonth * totalmonths * paymentpermonth

print("P.no",end=" | ")
print("Prior Bal",end=" | ")
print("Payment", end=" | ")
print("Interest",end=" | ")
print("Principal",end=" | ")
print("Post Bal",end=" ")
print("")
while paymentnumber != totalmonths:

paymentnumber = paymentnumber + 1
print(str(paymentnumber),end =" | ")
print(str(round(balancebeforepayment,2)),end =" | ")
principalincluded = paymentpermonth
payment = 0
if paymentnumber == 1:

payment = downpayment

interestincluded = principalincluded * interestpermonth
payment = payment + principalincluded + interestincluded
print(str(round(payment,2)),end =" | ")
print(str(round(interestincluded,2)),end =" | ")
print(str(round(principalincluded,2)),end =" | ")
balanceafterpayment = balancebeforepayment - payment
print(str(round(balanceafterpayment,2)),end =" | ")
print("")
balancebeforepayment = balanceafterpayment

Sample output

Enter purchase price: 1500                                              

P.no | Prior Bal | Payment | Interest | Principal | Post Bal            

1   |   1513.5   |   225.75   |   0.75   |   75.0   |   1287.75   |     

2   |   1287.75   |   75.75   |   0.75   |   75.0   |   1212.0   |      

3   |   1212.0   |   75.75   |   0.75   |   75.0   |   1136.25   |      

4   |   1136.25   |   75.75   |   0.75   |   75.0   |   1060.5   |      

5   |   1060.5   |   75.75   |   0.75   |   75.0   |   984.75   |       

6   |   984.75   |   75.75   |   0.75   |   75.0   |   909.0   |        

7   |   909.0   |   75.75   |   0.75   |   75.0   |   833.25   |        

8   |   833.25   |   75.75   |   0.75   |   75.0   |   757.5   |        

9   |   757.5   |   75.75   |   0.75   |   75.0   |   681.75   |        

10   |   681.75   |   75.75   |   0.75   |   75.0   |   606.0   |       

11   |   606.0   |   75.75   |   0.75   |   75.0   |   530.25   |       

12   |   530.25   |   75.75   |   0.75   |   75.0   |   454.5   |       

13   |   454.5   |   75.75   |   0.75   |   75.0   |   378.75   |       

14   |   378.75   |   75.75   |   0.75   |   75.0   |   303.0   |       

15   |   303.0   |   75.75   |   0.75   |   75.0   |   227.25   |       

16   |   227.25   |   75.75   |   0.75   |   75.0   |   151.5   |       

17   |   151.5   |   75.75   |   0.75   |   75.0   |   75.75   |        

18   |   75.75   |   75.75   |   0.75   |   75.0   |   0.0   |    

  

Add a comment
Know the answer?
Add Answer to:
reate a purchase-finance program that asks for a purchase price, requires a 10% down payment, and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT