There are lots of problems in function main(). Since I am responding to your post after 6 hours from when you posted it I hope you did not sit idle all this time watching TV, playing games, or anything else.
I could go on and on about all the problems I see in main() but it would be useless if you have already fixed most, if not all, of them. So please re-post your current program so we can see what progress you have made.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343