What Tarik is trying to explain is that your code blocks need some organization.
1 2 3 4
{
//code
}
Where ever there is a left parenthesis, there has to be a right.
Also, all your code must be in the main function, which you obviously know what a main function since you have written one, unless you want to write a separate function for. Try bringing this to the beginners forum. You'll get more help.