I wrote code for ATM challenge in java its runs perfectly without any errors for custom input, but why does it say as “the wrong answer” after submittion
‘’’
import java.util.;
import java.lang.;
import java.io.*;
/* Name of the class has to be “Main” only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception {
Scanner scan = new Scanner(System.in);
int cashWithdraw = scan.nextInt();
double accountBalance = scan.nextDouble();
if(cashWithdraw % 5 == 0 && accountBalance > (double) cashWithdraw + 0.50) {
double netBalance = accountBalance - ((double)cashWithdraw + 0.50);
System.out.println(netBalance);
} else {
System.out.println(accountBalance);
}
}
}
‘’’