diff --git a/ATM.java b/ATM.java new file mode 100644 index 0000000..e0ed7af --- /dev/null +++ b/ATM.java @@ -0,0 +1,20 @@ +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 sc = new Scanner(System.in); + double withdrawl_bal = sc.nextDouble(); + double curr_bal = sc.nextDouble(); + + if (withdrawl_bal % 5 == 0 && curr_bal >= withdrawl_bal + 0.5){ + curr_bal = curr_bal - (withdrawl_bal + 0.5); + } + // your code goes here + System.out.printf("%.2f",curr_bal); + } +}