rule 1: please be polite. this isn't a drive through window.
cout<<"I'm sorry, but we do not do your homework for you here...\";
cout<<"We only help with code presented...\n";
cout<<"Please edit your post with your code...\n";
cout<<"And again, please be polite...\n";
A couple weeks ago someone posted asking a very similar question. I replied, and you can take a look @ what I replied and also read what all the other wonderful members @ D.I.C. said also. I tried to be as clear as possible. Make sure you try to understand what I did, and look @ the big picture. Also ask any other questions if you have any. Hope this helps