Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

shawnf Group Title

Prob1c, RemainingBalance = (RemainingBalance*(1 + MonthlyRate)) - Payment Gives me 26956.44 for a monthly payment, but test case in handout shows 29643.05

  • 2 years ago
  • 2 years ago

  • This Question is Closed
  1. TuringTest Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    please show your whole code

    • 2 years ago
  2. shawnf Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    ## a credit card program that calculates the minimum fixed monthly payment needed in order to pay off a credit card balance within 12 months. ## this more complicated version uses a bisection search method and upper and lower bounds InitialBalance = float(raw_input('What is the outstanding balance?')) apr = float(raw_input('What is the annual interest rate?')) MonthlyRate = apr/12.0 PaymentLow = InitialBalance/12.0 PaymentHigh = (InitialBalance * (1 + MonthlyRate)**12.0)/12.0 Payment = (PaymentLow + PaymentHigh)/2.0 RemainingBalance = InitialBalance while ((RemainingBalance > 0.010) or (RemainingBalance < -0.010)): RemainingBalance = InitialBalance for i in range(12): RemainingBalance = (RemainingBalance*(1 + MonthlyRate)) - Payment if RemainingBalance > 0.010: PaymentLow = Payment Payment = (Payment + PaymentHigh)/2.0 if RemainingBalance < -0.010: PaymentHigh = Payment Payment = (Payment + PaymentLow)/2.0 print ('Monthly payment to pay off debt in 1 year: ' + str(round(Payment,2))) print ('Balance: ' + str(round(RemainingBalance,2)))

    • 2 years ago
  3. TuringTest Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    your formula to update the balance is wrong: RemainingBalance = (RemainingBalance*(1 + MonthlyRate)) - Payment payment needs to be subtracted before multiplication by 1+MonthlyRate

    • 2 years ago
  4. shawnf Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    I don't think that's correct. If you look at the handout (http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00sc-introduction-to-computer-science-and-programming-spring-2011/unit-1/lecture-4-machine-interpretation-of-a-program/MIT6_00SCS11_ps1.pdf) I'm using the same formula.

    • 2 years ago
  5. TuringTest Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    that link is not working for me, but I did the same problem once on OCW and once for edX so I think mine is right did you try it to see if you get the right answer

    • 2 years ago
  6. TuringTest Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    ?

    • 2 years ago
  7. shawnf Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    No it doesn't give the correct answer and it doesn't jive with interest payments. The interest accrues and then you pay off the interest plus a portion of the principle. I also checked my answer in excel and it is correct.

    • 2 years ago
  8. TuringTest Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    what are the inputs for balance and interest that you are trying to get the answer 29643.05 from?

    • 2 years ago
  9. shawnf Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Ah that's it, I was entering in .02 instead of .2 -- I did the program right. Thanks!

    • 2 years ago
  10. TuringTest Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    congrads lol

    • 2 years ago
    • Attachments:

See more questions >>>

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.