Got Homework?
Connect with other students for help. It's a free community.
Here's the question you clicked on:
 0 viewing
Hi fellow OCW students,
http://paste.bradleygill.com/index.php?paste_id=3801
Here is my code. For some reasons, it got stuck in infinite circles with 'while' loop; not being able to move on to the 'for' loop. I'm having hard time finding why.
 one year ago
 one year ago
Hi fellow OCW students, http://paste.bradleygill.com/index.php?paste_id=3801 Here is my code. For some reasons, it got stuck in infinite circles with 'while' loop; not being able to move on to the 'for' loop. I'm having hard time finding why.
 one year ago
 one year ago

This Question is Closed

MicroBotBest ResponseYou've already chosen the best response.0
i believe it's this : you say that your Fblance is the Oblance (outstanding balance on your credit card) and u need while loop to stop when it has found the ideal solution...that is when balance is 0 or less. (if i remember right the assignment request). so NOW your while loop will stop only if balance is [1,1] . And if it gets lower than 1 it will still run..... hope it helps!:)
 one year ago

bwCABest ResponseYou've already chosen the best response.0
put a print statement in the while loop to help you see where the problem is  kinda like this: http://dpaste.com/971222/
 one year ago

RCMoreaBest ResponseYou've already chosen the best response.2
Not sure if you still need this. I used your posted code to help me get started, and I just finished. My loop is a little different from yours, but here is the logic I used: You already know how to find your upperbound, lowerbound, and first guess. After that, this was my logic: 1) if remaining balance after 12 months is too high, raise your payment. 2) if remaining balance after 12 months is too low, lower your payment. 3) if remaining balance after 12 months is correct, then stop. To raise your payment, set payment = (payment+upperbound)/2. REMEMBER to also set your new lowerbound to equal your old payment. Actually, it's easier to do it in reverse order. Set lowerbound = payment, then raise payment. To lower payment, do the opposite. To recognize when you are done, basically since you are going in 1 cent increments and everything has to be the same, you could overpay by up to 11 cents. So, that is your range 11 to 0 for being done. I think that's right. I got the same answers as the professor within 2 cents, which I think is probably rounding and I'm not worried about it. The only other thing, which I did not bother allowing for, is what if you pay off in less than 12 months? This can only happen if you start out owing 12 cents or less, so I don't really care about this case, but if you do, you could set up a special if then loop just for this case. If you want, I can post code.
 one year ago

LoveMathFermatBest ResponseYou've already chosen the best response.0
Thanks guys! I figured it out!
 one year ago

zaraaliBest ResponseYou've already chosen the best response.0
please can anyone post the code of Problem set2 i'm doing this assignmnet since 5 hours but i,m getting so many errors in my code. please can anyone post the code here?
 one year ago

LoveMathFermatBest ResponseYou've already chosen the best response.0
which one are you referring to exactly? The one that I posted here or Problem Set #2 Successive Approximation and a Wordgame!???
 one year ago

zaraaliBest ResponseYou've already chosen the best response.0
I want a code for problem set 2 of PROBLEM 1: PAYING THE MINIMUM please can you post the code.
 one year ago

LoveMathFermatBest ResponseYou've already chosen the best response.0
Here is my code: http://pastebin.com/9jLBC55J Hope it helps!
 one year ago

zaraaliBest ResponseYou've already chosen the best response.0
did you complete your all assignment parts? please help me out i need help?
 one year ago

zaraaliBest ResponseYou've already chosen the best response.0
if we are checking are code on our dashboard on every submission it will deduct there marks or its just for correction?
 one year ago

zaraaliBest ResponseYou've already chosen the best response.0
please can anyone tell me that in code how to subtract the payment and add the interest for each month ? in paying the minimum assignment. please help
 one year ago

zaraaliBest ResponseYou've already chosen the best response.0
I have already wrote the program my output is also coming but the problem is in my output is that they giving all the same minmonthlypayment , remaining amount, is coming same for all months. what is wrong in code? please help me.
 one year ago
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
 Engagement 19 Mad Hatter
 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.