ATM: Keep getting WA no matter what I do.

,

Whenever I use the following code:

import java.util.Scanner;

public class ATM{

public static void main(String[] args){

Scanner in = new Scanner(System.in);
int withdraw = in.nextInt();
float balance = in.nextFloat();
if(withdraw > 0){
  if(withdraw % 5 == 0){ 
    if(withdraw < balance){
      balance -= withdraw + 0.50;
    }
  }
}
System.out.printf("%.2f\n",balance);

}

}

I always get WA. I have tested 0 0 fine, decimals, negitives, I always get the correct answer, but when I submit it, WA

Try

if(withdraw <= balance-0.5)

instead of

if(withdraw < balance)

As withdrawal can only be done if there is sufficient amount taking into consideration the charge for withdrawing.

test your code on this case:

30 30.25