a) If your control structures (if, for, etc) have a body of multiple statements, you'll have to encapsulate them with { }.
b) If you want help, tell us what the problem is. I can see many problems, but I'd rather have you describe what's wrong and ask specific pointers.
First off a title name like "I'm stuck on (put your problem here)" would look more professional and encourage more people to help you. Also there are rules against posting homework assignments, and most people would prefer just the small block of code giving you problems as opposed to a wall.