ATM: code working perfectly, but showing wa on your compiler

,

import java.util.*;
class atm
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int x;
double y;
x=sc.nextInt();
y=sc.nextDouble();
if((x>=y)||(x%5!=0))
{
System.out.printf("%.2f", y);
}
else
{
y=(y-x)-0.5;
System.out.printf("%.2f",y);
}
}
}

i got the mistake and got the correct code

if((x>=y)||(x%5!=0))

this test is unfortunately wrong.

you should consider the corner case when there is not enough money to include the fee of the withdrawal. :slight_smile: