Think about what you want to do. There is much information ion the paragraph you have included. Try to work out a process, refining into smaller steps.... Once you have worked out a basic flow for the program, then we can start thinking about coding. Hopefully by working out the flow, you will have simplified the problem sufficiently to make a start with the actual coding.
Post again, by all means, if you get stuck, but please try to be specific about exactly what the difficulty is, and how it was encountered. You won't find complete solutions here, but you will find a lot of help on the way to formulating your own.
