In the above code the error are very basic. Mostly syntax error. For example
if (timesTried < 5);{
if (userinput == x);{
semicolon after If statement and the bracket is missing to close the main function. I was not able to compile the code probably because I am missing .sun library. But other than that it should be good.