Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

JocelynC

  • 3 years ago

Sorry for all the questions! In the first problem, "Credit Card Debt," how would one find the total principle paid? I know that in the program below, it is all the values of r added up, but I can't figure out how to deal with it in each separate time it loops.

  • This Question is Closed
  1. JocelynC
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    ## Calculate balance for compound interest. x = float(raw_input('Enter current balance ')) y = float(raw_input('Enter annual interest rate ')) z = float(raw_input('Enter minimum monthly payment rate ')) for ans in range(1,13): t = x * z p = (y/12.0) * x r = t - p x = x - r print 'Minumun monthly payment ', t print 'principle paid ', r print 'remaining balance ', x print 'Total principle paid ', ~blank spot...~ print 'Balance ', x

  2. PhilipY
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    Total principle paid, start with a var outside your loop. So after you ask the user to input their x, y and z, name a new var and make it equal to 0. a = 0 in the loop, you do something like a = a + r and then at the end when you are printing your results, you just print var a. I think this should get you your total principle paid over 12 months

  3. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy