First of all I would like to tell you that this is not the good practice for asking question. You are asking code by giving us a concept? Are you not a programmer? If so, go and first try yourself. You know what are your inputs and what are you outputs.
Brainstorm it and do coding. If you got stuck on the way while coding then you need to ask the being specific where you got the problem. That the way to get help from forums and all other senior programmers.
Actually we will be giving you hints and direction to go... not a whole bunch of ready project.
Regards
MysticBoy