On Feb 14, 1:07 pm, "[email protected]" <[email protected]> wrote: > Dear All There are a couple of errors in it. Do you use NetBeans to make your project? If not, I would first recommend to use it, this way you will see the errors, before trying to compile it, with tooltip indicating what needs to be changed. So:
1 - Replace all the parentheses () with square braces when you want to access a value in an array by index. For example pinCount[rollIndex + 1] 2 - declare pintCount as private static variable in the class, not in the main method. Something like: private static int pinCount[] =... 3 - Change the parameter of score method to use the pinCount array, not a fancy *xxx, and make the method private. Something like: private int score(int[] pinCount()... 4 - Change the variable in the for loop to get from 1 to 9 instead of 0 to 10 5 - Remove pinCount from main method 6 - Create a new instance of Scorecard in main, like this: Scorecard scorecard = new Scorecard(); 7 - Invoke correctly the score method in main: scorecard.score(pinCount); 8 - Save all 9 - Run again By me, it gives: Total Score is: 240 Ask Java experts (which I'm not), if you want a philosophical view of the why, what, where, etc... of this. -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en
