Try it, in that format and see what happens. Try changing the for loops to while(myTokenizer.hasNextToken())... and check here I have given you the correct method name.
[campbell@computer java]$ java Q13
Andrew Smith 2012
This program will determine the winner of a game of baseball over 9 innings.
Enter a list of 9 inning scores for Team 1, e.g. 1,2,3,4,5,6,7,8,9: 8,2,4,1,2,8,5,6,1
Enter a list of 9 inning scores for Team 2, e.g. 1,2,3,4,5,6,7,8,9: 7,2,4,1,9,7,5,3,0
Team 2 won the game with a score of 17 over 9 innings. The losing team scored 23.
Andrew Alan Smith wrote:Hi everyone, thank you for taking the time to read my post and I was hoping somebody could be so kind as to point out what exactly is going wrong in my code.
Winston Gutkowski wrote:but here are a few general tips for you...
I know we usually avoid giving straight answers, but I thought it would take you ages to work out the problem. It took me long enough, and it wasn’t until I ran my code and saw those 0s that I had any idea what was happening. There are some solutions which beginners will never see, unless they are shown them.
Winston Gutkowski wrote: . . . Well, Campbell's basically given you the answer, . . .