public class HelloWorld {
public static void main(String[] args) {
System.out.println("Far-Cel Converter");
int lower, upper, step;
double far, cel;
lower = 0;
upper = 300;
step = 20;
far = lower;
while (far <= upper){
cel = (far - 32.0) * 5.0/9.0;
Math.round(far);
Math.round(cel);
System.out.print(far);
System.out.println("-");
System.out.println(cel);
far = far + step;
}
}
}
once I initialize the value of variable cel, I call on the math.round method to round the value of cel to the nearest number, but it doesn't for some reason. Does anyone know why?
Thanks :)


Sign In
Create Account


Back to top









