anonymous
  • anonymous
Problem set 2 #4
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.
chestercat
  • chestercat
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/assignments/pset2.pdf i'm getting nothing....
1 Attachment
anonymous
  • anonymous
Do you still have the fixed script from pset2c that I helped you make ?
anonymous
  • anonymous
alright i think i was overthinking #4 and trying to completely rewrite...this one yields the right answers and the values for the packages can be easily changed. but im wondering, i know it works, but is it what the problem set is asking for?
1 Attachment

Looking for something else?

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

More answers

anonymous
  • anonymous
Your first answer is right but when it says the largest number that cannot be bought is 50 which is wrong. Also what I did on mine is put a raw_input so that I don't have to change the code when I want to change the sizes.
anonymous
  • anonymous
remember in your pset2c code your while loop was while count<5.( not 6) so therefor your while loop is while count
anonymous
  • anonymous
does that work in all scenarios? because the point is to have 6 (or whatever the smallest package size is) consecutive integers
anonymous
  • anonymous
heres one that works, its just a little different because the final result is n-(x+1)
1 Attachment
anonymous
  • anonymous
by doing while count
anonymous
  • anonymous
but say theres a sequence that reaches a count of x-1 but then doesnt make it all the way to x
anonymous
  • anonymous
it would still go through
anonymous
  • anonymous
and you don't want it to in that scenario
anonymous
  • anonymous
it happens to work in the 6,9,20 scenario because the first sequence of 5 ALSO happens to be the first sequence of 6 but say it wasnt?
anonymous
  • anonymous
I don't get what your saying because if the count<1 less than x it will stop at the same point asprinting n-(x+1)
anonymous
  • anonymous
ahhh whatever its too hard to explain in words lol... both our ideas work so just use the one that makes sense to you haha.. arite cya
anonymous
  • anonymous
haha alright later
anonymous
  • anonymous
Hey sorry about earlier I had just woke up and what you were typing jut wasn't making sense but yes you are right the way I did mine won't come out correctly every time thanks for pointing that out and I fixed mine haha.

Looking for something else?

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