Program of simple IMC in Java