HW 3

Hi Professor,

I only see comments for tasks 04/05, which were the last two that I committed and I wanted to make sure that all of them were submitted?

Sam

On 15 Sep 2014, at 19:41, "Chad Heuschober" <notifications@github.com<mailto:notifications@github.com>> wrote:


In task_05.py:

> +    IR = 639
> +elif (PRINCIPAL >= 200000 and PRINCIPAL < 1000000) and DURATION <= 15 and PQ == "y":
> +    IR = 302
> +elif (PRINCIPAL >= 200000 and PRINCIPAL < 1000000) and DURATION <= 15 and PQ == "n":
> +    IR = 398
> +elif (PRINCIPAL >= 200000 and PRINCIPAL < 1000000) and (DURATION > 15 and DURATION <= 20) and PQ == "y":
> +    IR = 327
> +elif (PRINCIPAL >= 200000 and PRINCIPAL < 1000000) and (DURATION > 15 and DURATION <= 20) and PQ == "n":
> +    IR = 408
> +elif (PRINCIPAL >= 200000 and PRINCIPAL < 1000000) and (DURATION > 20) and PQ == "y":
> +    IR = 466
> +elif PRINCIPAL <= 1000000 and DURATION <= 15 and PQ == "y":
> +    IR = 205
> +else:
> +    IR = 262
> +TOTAL = int(PRINCIPAL * ((1 + (IR / 10000) / 12)) ** (12 * DURATION))


You might want to review your integer division here. your IR integer will not produce a float or a decimal this way. Try collecting the interest rates as strings, eg '0.0262', then doing decimal conversion after the big nested if. Remember that 0.0262 is a float and if you pass that to decimal.Decimal() you'll just have a decimal of a float! Be sure to pass it a string.

Another thing to keep your eye on is the expectation that TOTAL should be None if an incorrect input was given, eg, > 1,000,000 but not prequalified. Your current code does not gate for that.

-
Reply to this email directly or view it on GitHub<https://github.com/is210-2014-fall-02/is210_lesson_03/pull/11/files#r17556773>.