A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • one year ago

I need help on problem 1 part 2 I know you have to do a for loop for the monthly payment and a nested for loop for the months but something about my code is not right: x = float(raw_input('Enter the outstanding balance on your credit card: ')) y = float(raw_input('Enter the annual credit card interest rate as a decimal: ')) MMP = 0 MIR = y/12.0 month = 0 for MMP in range(0, 1200, 10): NB = x*(1+MIR) - MMP for i in range(1, 13): NB = x*(1+MIR) - MMP x = NB print NB print MMP if NB >= 0: month += 1 else: break

  • This Question is Closed
  1. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    and it cut off my print code but I have that below the else: break part

  2. amistre64
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    what is it spose to do? and what is it doing?

  3. Jaynator495
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 2

    Welcome To OpenStudy! Here you will find great helpers and friends, a community of students that help students! We hope you enjoy the experience!

  4. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Use a for loop within a while loop. Set the while loop condition so that it will terminate when the balance hits 0 or less. This is how i wrote it: out_balance = float(raw_input("Enter the outstanding balance on your credit card: ")) annual_interest = float(raw_input("Enter the annual credit card interest rate as a decimal: ")) monthly_interest = (annual_interest/12.0) + 1.0 min_pay = 0 updated_balance = out_balance while updated_balance = out_balance: updated_balance = out_balance min_pay += 10 for month in range(1, 13): updated_balance = updated_balance * monthly_interest - min_pay if updated_balance <= 0.0: break print "RESULT" print "Monthly payment to pay off debt in 1 year: " , min_pay print "Number of months needed: " , month print "Balance: " , round(updated_balance, 2)

  5. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Thank you so much, that was very helpful! Although I will say it didn't work until I changed the while loop to: while updated_balance >= 0: etc. etc.

  6. 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

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.