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:
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