Use an if statement to detect the desired values
and a counter to count them.
Type: Posts; User: Norm
Use an if statement to detect the desired values
and a counter to count them.
Work on one problem at a time
Please copy the full text of the error message and paste it here. It has important info about the error.
What does that mean?
What is printed when you print the values of all the variables used on the line where the NPE happens?
Something must print if the statement is executed. Be sure to put the...
Did you find the variable with the null value?
To find it, Add some print statements to print out the value of all the variables used on line 35 where the NPE happened.
A value of 0 is not a...
What variable has the null value? How did the variable get the null value?
That String has a leading space which is not a valid numeric digit. Use the String class's trim method to strip off leading/trailing spaces.
Please copy the full text of the error message and paste it here. It has important info about the error.
Add some print statements in all of the methods and loops to show where the program is executing.
Please explain what happens when you compile and execute the program.
If there are error messages, copy the full text and paste it here.