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 > 0 && w_cash <= 2000) && (balance >= 0 && balance <= 2000)) {
- if((w_cash % 5) == 0 && w_cash < balance) {
- double r_cash = balance - w_cash ;
- System.out.println(r_cash - 0.50);
- }
- else if(w_cash >= balance || (w_cash % 5) != 0) {
- System.out.println(balance);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment