Most likely you may need to clear the buffer after reading in the double. This is a pretty common issue when using scanners.