fork download
  1. import java.util.Scanner;
  2. public class Main
  3. {
  4. public static void main(String[] args)
  5. {
  6. float amm=0,w=0;
  7. Scanner i= new Scanner(System.in);
  8. System.out.println("Input\n"); w=i.nextInt();
  9. if(amm>2000 || amm<0)
  10. System.exit(0);
  11. amm=i.nextFloat();
  12. if(w>2000 || w<0) System.exit(0); if(w>amm)
  13. {
  14. System.out.println("Insufficient Funds");
  15. System.exit(0);
  16. } if((w%5)!=0)
  17. {
  18. System.out.println("Invalid withdrawl ammount"); System.exit(0);
  19. }
  20. amm=amm-w; System.out.println("Output:\n"+(amm-0.5));
  21. }
  22. }
Success #stdin #stdout 0.06s 246080KB
stdin
30 120.00
stdout
Input

Output:
89.5