Here's what ya do.
1) Push your keyboard aside
2) grab a piece of paper and a pen
3) Write in plain english the steps you have to take to write this program
4) Write the same thing in pseudocode using english, but the code structures you need
5) Look it over, make sure it all makes sence
6) Code the program.
7) Test it for bugs
8) Check with us if you have some code, and have attempted to try to get it done
we're not a homework service, sorry, i don't have time to write a program for everybody who comes on this forum, I do have time however to help people with problems like,
for(int i = 0; i < -1; i++) { blabla }; why doesn't this work?
Give it a try, come here with specific problems.
good luck, please don't take my rant personally, it goes for everybody who expects us to be able to write something like this in 10 minutes.
Dizz