You are calling x.hasNextInt()
and the Scanner waits for another input to check if it is an int. You are also reading in an int and assigning it to a double (which an int is not). And to further it, you pass your int/double hybrid to Math.round which converts it to a Long and then casts it to an int and tries to assign it to a double.
If you are wanting to check if an a line is an int, you should try something like:
System.out.println("Please enter an integer.");
String line = x.nextLine();
int res=0;
try{
res=Integer.parseInt(line);
}catch(Exception e){
System.out.println("Not a number");
}