The prompt says:
Input a double and print the first three digits after the decimal point with a space between them.
Sample run:
Please input a decimal number:
67.3424
Answer: 3 4 2
What I have so far
Scanner scan = new Scanner(System.in);
System.out.print("Please input a decimal number: ");
double hit_n = scan.nextDouble();
double hit_4 = hit_n % 10;
hit_n /= 10;
double hit_3 = hit_n % 10;
hit_n /= 10;
double hit_2 = hit_n % 10;
hit_n /= 10;
double hit_1 = hit_n % 10;
System.out.println(hit_1);
System.out.println(hit_2);
System.out.println(hit_3);
System.out.println(hit_4);
The problem with this code is that it keeps printing the decimals added when you input them.