This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
First of all, you should have a good programing style because of which the code becomes more manageable and eligible.
I saw your code and then, you have two more ending braces than required. Its generally that newbies have habit of opening bracket, then write the code and in the end close it. This can lead to syntax errors and hours of headaches to find the problem.
A simple solution to this is ,once you open a bracket, close it straight away and then start writing the code within the brackets.
Always use proper indentations.
Make sure you write as many comments as you can that will help others to identify how a variable or method behaves and reduces the difficulty of understanding the code.
For now here is the code syntax error free code.
Also last but not the least, make sure you change the habit of naming methods.
for more info, google for programing standards, choose a style which suites you.
Joined: Feb 09, 2010
yea i can get it to compile now no problem..but my problem is that when i execute the program all it says is what i rolled not if i won or lost.
Joined: Dec 29, 2009
Well take a proper look at the program.
You have written a method,but you are not invoking it.
I have not tried this, but for sure you are not invoking it in this program.