A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing


  • 5 years ago

Hey I don't get how to do Problem 3 of pset 2. I don't know if it's necessary but here is my answer for problem 1 of pset 2. http://pastebin.com/N7gS2uvM and here is my code so far from problem 3 i keep getting no solution for all answers tho.

  • This Question is Closed
  1. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Just before pset2 prob 3 there is an explanation of how to write the code for prob 3 - try to turn it into a function. The theory is that if you can find 6 successive numbers of nuggets that you CAN buy then you can buy all numbers above that number. So just start at one, can you buy one? no, can you buy two? no ... keep increasing the number - every time you find a number you can't buy, save it. If the theory is true, eventually you will find six in a row that you CAN buy - you are done - the last number you saved (because you could NOT buy it) is the highest number of of nuggets you can't buy ... there are probably other ways to do it it helps to put print statements in your code to see what it is doing and see if it is doing what you want - print variables, print counters, print results of tests or calculations. you can always comment them out when they become obnoxious

  2. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Sorry I forgot to post the second link last night i have already started it i just keep getting no solution and i don't know why? http://pastebin.com/ypiRdb5k

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

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

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...


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