Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ATM
- {
- public static void main(String[] args)
- {
- java.util.Scanner sc = new java.util.Scanner(System.in);
- double w_cash = sc.nextDouble();
- double balance = sc.nextDouble();
- if((w_cash % 5) == 0 && w_cash < balance)
- {
- double r_cash = balance - w_cash ;
- System.out.println(r_cash - 0.50);
- }
- else
- {
- System.out.println(balance);
- }
- }
- }
Add Comment
Please, Sign In to add comment