Question

In: Computer Science

The credit plan at TidBit Computer Store specifies a 10% down payment and an annual interest...

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: The month number (beginning with 1) The current total balance owed The interest owed for that month

The amount of principal owed for that month The payment for that month 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.

I am using Python.

Solutions

Expert Solution

PYTHON CODE:

# getting the purchase price from the user
purchase_price=float(input('Enter the purchase price: '))

# variable for month counting
month = 1

# calculating the monthly payment
payment = purchase_price * (5/100)

# assigning the purchase price to the starting balance
starting_balance = purchase_price

# calculting the monthly interest rate
monthly_rate = (12/12) / 100

# header for tabular column
header='|{0:^7s}|{1:^17s}|{2:^16s}|{3:^17s}|{4:^9s}|{5:^16s}|'

# string for table header
m='Month'
sb='Starting Balance'
int_pay='Interest to Pay'
pri_pay='Principal to Pay'
pay='Payment'
end_bal='Ending Balance'

# printing the header
print('\n+'+'-'* 87+'+')
print(header.format(m,sb,int_pay,pri_pay,pay,end_bal))
print('+'+'-'* 87+'+')

# header for various values in the calculation
header2='|{:^7d}|{:^17.2f}|{:^16.2f}|{:^17.2f}|{:^9.2f}|{:^16.2f}|'

# looping
while starting_balance > 0:

    # calculating the interest
    interest = monthly_rate * starting_balance

    # calculating the principal
    principal = payment - interest

    # temporary variable to store the starting balance
    t= starting_balance

    # calculating the end balance
    starting_balance -= payment

    # printing the values
    print(header2.format(month,t, interest, principal,payment, starting_balance))

    # incrementing the month
    month+=1
  
print('+'+'-'* 87+'+')


SCREENSHOT FOR CODING:

SCREENSHOT FOR OUTPUT:


Related Solutions

The annual interest rate on a credit card is 14.99%. If a payment of $300.00 is...
The annual interest rate on a credit card is 14.99%. If a payment of $300.00 is made each month,how many months will it take to pay off an unpaid balance of $2,508.59? Assume that no new purchases are made with the credit card
You want to buy a home for $259,000. You plan to pay a 10% down payment,...
You want to buy a home for $259,000. You plan to pay a 10% down payment, and take out a 30 year loan for the rest. a. How much will the loan amount be? b. What will your monthly payments be if the interest rate is 5% C. what will your monthly payments be if the interest rate is 6%?
You want to buy a $252,000 home. You plan to pay 10% as a down payment,...
You want to buy a $252,000 home. You plan to pay 10% as a down payment, and take out a 30 year loan for the rest. a) How much is the loan amount going to be? $ b) What will your monthly payments be if the interest rate is 6%? $ c) What will your monthly payments be if the interest rate is 7%? $
You want to buy a $218,000 home. You plan to pay 10% as a down payment,...
You want to buy a $218,000 home. You plan to pay 10% as a down payment, and take out a 30 year loan at 6% interest for the rest. a) How much is the loan amount going to be? $ b) What will your monthly payments be? $ c) How much total interest do you pay? $ d) Suppose you want to pay off the loan in 15 years rather than 30. What will your monthly payment be? $ e)...
A travel agent arranged a payment plan for a client. It required a down payment of...
A travel agent arranged a payment plan for a client. It required a down payment of $300 and 12 monthly payments of $567. What was the total cost of the plan?
An engineer buys a piece of lot for 250000 down payment and 10 deferred semi-annual payments...
An engineer buys a piece of lot for 250000 down payment and 10 deferred semi-annual payments of P20,000 each, starting 3 ½ years from now. What is the present value of the investment if the rate of interest is 11.5% compounded quarterly? *CASH FLOW Diagram Needed
A 10-year annual payment corporate bond has a market price of $1,050. It pays annual interest...
A 10-year annual payment corporate bond has a market price of $1,050. It pays annual interest of $100 and its required rate of return is 9 percent. Is the bond fairly priced, underpriced, or overpriced? Also find the magnitude of the mispricing (if any).
Cost of Home: $225,000 Down Payment: $15,000 Annual Interest Rate: 6.960% Number of Years: 25 In...
Cost of Home: $225,000 Down Payment: $15,000 Annual Interest Rate: 6.960% Number of Years: 25 In addition, enter $400 as an additional principal payment for month 36 and $100 as an additional principal payment for month 75. what is the monthly closing balance from month 52
you plan to buy a boat for $10,000 and the terms are 20% down payment with...
you plan to buy a boat for $10,000 and the terms are 20% down payment with the balance to be paid over 40 months in equal monthly installments. If the first payment is one month from today and the interest rate is 24% per year, what is the value of each installment? (round to the nearest dollar)
You plan to borrow $100,000 at a 10% annual interest rate. The terms require you to...
You plan to borrow $100,000 at a 10% annual interest rate. The terms require you to amortize the loan with 10 equal end-of-year payments. How much interest would you be paying in Year 1?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT