 # ATM Problem unsolveD

I could not solve ATM problem can anyone help me

here,Transcation successful if and only if,
withdraw_bal + 0.5 >= init_bal and withdraw balance is multiple of.

if transaction is success,then
ans = init_bal - withdraw_bal - 0.5
else
ans = init_bal
here, 0.5 is successful transaction charge and take all values in double.

@savaliya_vivek
can you help why do i get nzec error on running the given program for ATM problem?

import java.io.;
class atm_chefcodebeginner
{
public static void main(String args[])throws IOException
{
int X;
float Y;
if((X%5!=0)||(Y<X+0.5))
{
System.out.println(Math.round(Y
100.00)/100.00);
}
else
{
Y=(float)(Y-(float)X-0.5);
System.out.println(Math.round(Y*100.00)/100.00);
}
}
}

I m not familiar as much with java, so i dont able to give reason.

import java.io.;
import java.util.
;
class atm_chefcodebeginner
{
public static void main(String args[])throws IOException
{
float X,Y;
Scanner sc = new Scanner(System.in);
X=sc.nextFloat();
Y=sc.nextFloat();
if((X%5!=0)&& (Y<X+0.5))
{
System.out.println(Math.round(Y100.00)/100.00);
}
else
{
Y=(float)(Y-(float)X-0.5);
System.out.println(Math.round(Y
100.00)/100.00);
}
}
}

also, some other changes is also required in your code.
so,observe both program.

actually my code works fine .
can you refer me to someone who is much familiar with java?