in reply to Multiple loops and comparisions
What's your question? What are you having difficulty with? What have you tried?
It rather looks like you think you can post a specification here and someone will do your work for you.
-- Ken