Use the values in [] shown in this:
Please edit your post and wrap your code with code tags:
[code] <<<<<<<<< BEFORE THE CODE
**YOUR CODE GOES HERE**
[/code] <<<<<<<<<<<<< AFTER THE CODE
to get highlighting and preserve formatting.
One goes before the code and one after.
Also post the contents of the console from when the program is compiled and executed to show what the problem is.
Be sure to add comments in the posted text to show where the unexpected values are.
Your problem is with the way the Scanner class's methods work.
Here is a description:
https://www.geeksforgeeks.org/why-is...ext-functions/