Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

superavocado

  • one year ago

I'm having trouble with ps1-b, my code doesn't work for a monthly payment that's bigger than 10 $. But I don't know why. Can someone help me? balance = float(raw_input("Enter the outstanding balance: ")) an_int_rate = float(raw_input("Enter the annual interest rate as a decimal: ")) mon_int_rate = an_int_rate/12 mon_pay = 0; while balance > 0: mon_pay += 10 n = 0 while n < 12 and balance > 0: print mon_pay, n n += 1 interest = mon_int_rate * balance balance -= mon_pay balance += interest balance = round(balance,2)

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

    could you post the actual question as well please?

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

    Found my mistake. I used the "wrong" balance. Sorry I assumed that there are more people doing the same course (mit 6.00), that would know what I'm talking about.

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

    • Attachments:

Ask your own question

Ask a Question
Find more explanations on OpenStudy

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.