Task 2 of 7 · 0 solved · 7 to go0%
You can read the problem, but answers are checked only for signed-in students. Sign in to answer →

6.1 Scanner — sum the integers

Total: 0 / 3 pts
Practice mode — check each part and get hints as you go.
Task

Fill in sumInts so that it returns the total of every whole number the scanner can still read.

Use in.hasNextInt() to know when to stop. For the demo scanner the program prints 12.

Your solution