That would do it.
Type: Posts; User: Norm
That would do it.
What is printed by the code in post#12? Are there items on a line that are not printed?
Add a println() to print the contents of the variable: line so you can see the full text of the line as well...
The problem with that code is that the token is only printed and then not used for the total.
The code needs to:
assign the token to a String,
print the String
parse the String to a double...
Where is the debug println()s output that shows what values were read and used in computing the total?
Please explain. Post the current output and the expected output.
Try debugging the code by adding println() statements that print out the tokens that are returned by nextToken() so you can see...
The contents of the variable: str is NOT parseable to a double. str contains many values each of which can be parsed.
The StringTokenizer class separates out the parts of str that can be parsed. ...
The code at line 109 used an invalid String in the call to the parseDouble() method. Check the code to see what String should be used.