Math.round...I need help understanding what I am doing wrong and why it's not working

Hi, I don't understand what am I doing wrong, I just can't get the right answer no matter what I change. Here is the code:

Code java:

import java.io.*;
import static java.lang.System.*;
import java.util.Scanner;
import java.lang.Math;
class Assignment2 {
public static void main (String str[]) throws IOException {
Scanner scan = new Scanner(System.in);
System.out.println("Please enter two decimal");
double x = scan.nextDouble();
double y =scan.nextDouble();
int temp = (int)Math.round(100*x);
System.out.println(1.0*(200-temp)/100);
System.out.println((y - x));
}
}

I am getting .53 and I should be getting 0.527

Anyone explanation and/or feedback, will be greatly appreciated. I have tried everything but can't get 0.527

Thanks

Hilda :confused:

Re: Math.round...I need help understanding what I am doing wrong and why it's not working

Try to compress your code a little bit, so it will be better to read.

I'm not sure if you need to import all that stuff, try looking at that.