A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • 5 years ago

I've just finished problem set 2 - question 4: can someone check it for me...? somehow it gets so long and its kinda weird...i just learned for 2 days so dont know many codes...

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

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

    I just finished this assignment myself, so I may not have enough experience to help you fully. What are your packet sizes? From looking at your code, it looks like they are 10, 20, 50. Your code says that the largest quantity you can't buy exactly is 53. But you can't buy 54 nuggets, can you?

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

    oh actually it was actually 7, 10, 20 haha the 50 is the size of tested x because i break the problem into bracket [0,50] [51,100] and [101,150] to avoid testing too many cases so i set x = 50 at first to test whether 50 is larger than the largest quantity or not

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

    Oh, my mistake. Your code seems to work when I use it, but I can't really help you because you use functions, which I am just now learning about and are not necessary for solving this problem.

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

    oh thanks anyway (well did i use any function...? lol...) im at the beginning too so yea...

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

23

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