We aren't going to write code for you, but we'll help you think through the problem.
How do you know that the change is obviously what it is? A big part of programming is taking things that humans "just do" and thinking about the steps involved in the process.
Pretend you have a really dumb friend who has no idea how to make change. Write out a list of instructions (in English, not in code) that your friend could follow to get the job done. Remember how dumb your friend is, so make sure the instructions are as short and simple as possible! When you have that written out, you'll have yourself an algorithm that you can start converting into code.