Change the integers & doubles to floats and let the scanner read it as a float [scan.nextFloat();].
Note: make sure you import the scanner class (java.util.Scanner;).