Answer:
x = scan.nextDouble();
if(x == Math.floor(x)){
System.out.println("False. The number is not a double");
} else {
System.out.println("True. The number is a double");
}
Step-by-step explanation:
First,
x = scan.nextDouble();
allow the receive input to be assigned to the already declared x.
The next block of if-else statement evaluate to true or false depending on if the number entered is a double or not.
The if statement check if the flooring of x is the same as x, if it is, then the number is not a double else if they are not the same the it is a double.
The flooring of a number remove the decimal part of the number and the decimal part of the number is what define a number as double.