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

minimallinux Group Title

Why is error ? 'int object not callable' high = (balance(1 + monthlyInterestRate)**12)/12 http://codepad.org/L6SUqoTC Unfortunately, I have limited idea how this one works it hasn't sunk in yet, maybe I need a breakl

  • one year ago
  • one year ago

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

    u forgot an operator there so maybe thats why?

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

    Spend time to fully understand the math in this problem and the bisection method. And stop programming so late at night xD! makes u make mistakes:P Plus, i dont know if im wrong but, wouldn't it be better to assure this will be a float division by dividing it with 12.0 and not 12 ,that could give you an integer division and create wrong results?

    • one year ago
  3. minimallinux Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Yes Ill do that in morning, Thanks (Haven't really got a grip of the bisection method yet)

    • one year ago
  4. Gianko15 Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    It's very tricky the bisection method, try with a simple example, and gradually make it bigger. Also @MicroBot the monthlyInterestRate (= annualInterestRate/12); is float because the annual rate is always a float number (0.2 or 0.4 or 0.18).

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

    while (pay - balance)>= epsilon: This line is wrong. pay is the *monthly* payment according to your code, and since the way you have coded this balance will never change, pay>>balance always so this loop will never terminate. You need to find a way to keep track of the balance (that should be updated every lop btw) that will result from a particular monthly payment. I will tell you that I had to introduce a new variable about the balance to solve this problem, though I'm sure there are more ways.

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

    also your pay=(high+low)/2 at the end seems to be on the wrong indent

    • one year ago
  7. TuringTest Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    I have no idea what int it thinks you are trying to call, but perhaps it is what @MicroBot says about the high = (balance(1 + monthlyInterestRate)**12)/12 perhaps it thinks you are trying to call a function balance on (1 + monthlyInterestRate)**12 ?? that's just a guess though

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

    so yeah, definitely put that operator in there

    • one year ago
  9. Gianko15 Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    Yeah he miss the * Another tip, epsilon is a tiny value (0.001 for example), as @TuringTest said is an endless loop, try to compare to a difference of values, maybe you can try to compare both balances, the current and the one you get with the pay obtained from your algorithm.

    • one year ago
  10. MicroBot Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    @turingtest 1: Yes, about the int problem i was thinking exsactly that...that since there is no operator, it thinks of it as a function call or smthing. 2: About the float division: i was talking again about the same statement high = (balance(1 + monthlyInterestRate)**12)/12 that i believe it should be better written as: high = (balance(1 + monthlyInterestRate)**12)/12.0 but seeing it now...since there is monthlyInterestRate in there it will be a float anyway:P (see @minimallinux when you answer questions late at night and you are tired ,you say things non accurate:P)

    • one year ago
  11. msmithhnova Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    The error is due to this high = (balance(1 + ... as microbot said in the first post missing operator. It needs to be high = (balance*(1 + ... notice the addition of the * operator. We understand that * is implied when we look at it but the computer does not, sometimes hard to spot as it 'looks normal' to us.

    • one year 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.