anonymous
  • anonymous
Can anyone tell me what is wrong with this code? Why is there a syntax error with 'B > 0?' https://gist.github.com/anonymous/6115943
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
katieb
  • katieb
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
B >0?
anonymous
  • anonymous
I'm sorry, I meant y > 0
anonymous
  • anonymous
IN the first while statement.

Looking for something else?

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

More answers

anonymous
  • anonymous
I usually put the condition in parenthesis
anonymous
  • anonymous
Ah. Not a bad idea. I will do that and let you know.
anonymous
  • anonymous
But you aren't really setting up your variables properly. I'm seeing a and y, which I'm not sure what they mean...I'd assign better variables so that we can troubleshoot better.
anonymous
  • anonymous
Good call. I am going to go through and be more descriptive and then I'll get back to you.
anonymous
  • anonymous
here it is with revisions. https://gist.github.com/anonymous/6116090
anonymous
  • anonymous
Sorry, just a sec. I forgot to convert a couple variables.
anonymous
  • anonymous
https://gist.github.com/anonymous/6116132
anonymous
  • anonymous
I had a similar problem with the while loop and decided to just declare the variable before i started the loop. Keep at it it will all of a sudden come to you after you are so annoyed with it and it will look easy after that. I spent a major portion of my day/night yesterday conquering this vexing problem.
anonymous
  • anonymous
There's a bunch of issues, regarding loops but also variables names. You should fix your variables names before trying to fix loops. I posted a comment on your Gist
anonymous
  • anonymous
Btw, i forked your gist file to show you some naming errors and provide some advices. However, your code still wont work as is, as there are issues regarding your loops and tests (ex: your "if" statement checks if remainder is > 0 while you are already in a "while" loop designed to be executed only if remainder is > 0...).
anonymous
  • anonymous
You have not declared what "remainder" is before the while loop. You cannot perform a comparsion between remainder and 0 unless remainder has a value. Also, you do not have the right number of brackets here: "initialmonthlyballance = round(float(((annualrate /12)*outbal)+outbal, 2)"
anonymous
  • anonymous
comments added http://dpaste.com/1324144/

Looking for something else?

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