Yes, it's also wrong about the point where you do calculations.
1) Initialize double variables to 0.
2) For each input, use nextLine() and assign to a String variable. If and only if the string...
Type: Posts; User: andbin
Yes, it's also wrong about the point where you do calculations.
1) Initialize double variables to 0.
2) For each input, use nextLine() and assign to a String variable. If and only if the string...
It's sufficient the javadoc parseDouble
Use nextLine(), if the line is "empty" it means the value is skipped. If non-empty, convert to double using Double.parseDouble(String) method.