Question: Why is my code looping for infinity? Here is the question prompt: The credit plan at TidBit Computer Store specifies a 1 0 % down
Why is my code looping for infinity? Here is the question prompt:
The credit plan at TidBit Computer Store specifies a down payment and an annual interest rate of Monthly payments are of the listed purchase price, minus the down payment.
Write a program in the file tidbit.py 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
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 The amount of principal for a month is equal to the monthly payment minus the interest owed. LO:
My code:
# Request the inputs and convert values
downPayment
annualInterest
paymentPercentage
purchasePrice floatinputEnter the purchase price:
#calculate starting, monthly interest, and payment
startingBalance purchasePrice purchasePrice downPayment
payment startingBalance paymentPercentage
interest annualInterest
month
#display the header
printssssssMonth "Starting Balance", "Interest to Pay",
"Principal to Pay", "Payment", "Ending Balance"
#compute and display results
while startingBalance :
if startingBalance payment:
principal startingBalance
payment startingBalance
interest
else:
interest startingBalance interest
principal payment interest
endingBalance startingBalance principal
printdfffffmonth startingBalance,
interest, principal, payment, endingBalance
startingBalance endingBalance
month
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
