Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.10 seconds.

  1. Replies
    33
    Views
    7,732

    Re: Modifying "Coin change" program

    Maybe I don't understand the problem correctly, but wouldn't a standard greedy algorithm (take the best available option, discard the rest) not always find the answer? For example, say you want to...
  2. Replies
    33
    Views
    7,732

    Re: Modifying "Coin change" program

    I didn't delete that post, and I actually said that I didn't count that post as spoonfeeding, since it simply showed you how to use an Object- which is an option I presented, but simply using...
  3. Replies
    33
    Views
    7,732

    Re: Modifying "Coin change" program

    That's a good idea.

    But for the record, I do think that people learn from getting code to play around with- in fact, in my spare time I work on little open source programs that novice programmers...
  4. Replies
    33
    Views
    7,732

    Re: Modifying "Coin change" program

    Fair enough. But that's why people complain about spoonfeeding. Lesson learned, I suppose.
  5. Replies
    33
    Views
    7,732

    Re: Modifying "Coin change" program

    Edit- This post was in response to Tjstretch offering a spoonfed solution that didn't actually solve the problem (he then claimed he was going to ignore complaints about spoonfeeding). This is one of...
  6. Replies
    33
    Views
    7,732

    Re: Modifying "Coin change" program

    This is why I think you're a troll. You don't know me, and your arguments are illogical and pointless- and they make it less and less likely that anybody is going to want to help you. Had you...
  7. Replies
    33
    Views
    7,732

    Re: Modifying "Coin change" program

    And if you still want help, you'll have to be more specific than that- what about this don't you understand? Did you write out what you'd do like I suggested? Even somebody who doesn't want to learn...
  8. Replies
    33
    Views
    7,732

    Re: Modifying "Coin change" program

    I'm perfectly happy. But I'm not going to write your program for you. If you want somebody to do it for you, there's a Paid Java Projects forum here. That's not my style, as I'm here to learn how to...
  9. Replies
    33
    Views
    7,732

    Re: Modifying "Coin change" program

    It's not hard to code. It might be hard to take somebody else's solution without understand what it's doing and try to hack away at it, but the theory is pretty standared. Hint: find all the...
  10. Replies
    33
    Views
    7,732

    Re: Modifying "Coin change" program

    Nice try.

    Like I asked before- how would you do this on paper, without a computer? Pretend you have a really dumb friend that has no idea how to do it. Write out instructions that he could follow...
  11. Replies
    33
    Views
    7,732

    Re: Modifying "Coin change" program

    I guess I'm thinking of a greedy algorithm then. So you want the lowest number of coins? That's still not extremely difficult.

    Anyway, you've heard my advice. Take it or leave it.
  12. Replies
    33
    Views
    7,732

    Re: Modifying "Coin change" program

    That's the problem, then. You absolutely have to know what you want the program to do before you can write it (or modify it). This is a fundamental aspect of programming, and it's one of the hardest-...
  13. Replies
    33
    Views
    7,732

    Re: Modifying "Coin change" program

    Well, at some point you have to be removing a coin value from the total, right?

    But really, if you got this code from somewhere else and you don't really understand what it's doing, I really...
  14. Replies
    33
    Views
    7,732

    Re: Modifying "Coin change" program

    If you're not familiar with the code, then I suggest you go through it with a debugger and a fine-toothed comb until you understand exactly what it's doing. Copying and pasting code from the internet...
  15. Replies
    33
    Views
    7,732

    Re: Modifying "Coin change" program

    Returning an array with mixed types seems really gross to me. Make an Object that holds that information instead.

    Or go with my original suggestion- make a Coin Object that holds its own value-...
  16. Replies
    33
    Views
    7,732

    Re: Modifying "Coin change" program

    What do you mean you want it to return two things? That's not possible. And how does using a HashMap help you with this?

    You can, however, return a List of things. I suggest you create a Coin...
Results 1 to 16 of 16