Integers vs. Doubles in Java
Java will not let you assign a float or double value directly to an integer variable: you'll get an compiler error:
Error: BadFile.java:110: possible loss of precision
The simplest solution is to insert an explicit cast-to-int operation, e.g., changing code like
int n = a/b + c/d;
to
int n = (int) (a/b + c/d);
Depending on the context, you could change the code to
double n = a/b + c/d;
but if you really need an integer, the cast approach (or something equivalent) is necessary.