how to code the overdraft limit in java

Solutions on MaxInterview for how to code the overdraft limit in java by the best coders in the world

showing results for - "how to code the overdraft limit in java"
Ismael
24 Jan 2019
1    if (balance - amount - 5 < 0) {
2        System.out.println("Insufficent funds");
3        System.out.println("Would you like to apply for an ovedraft?");
4        System.out.println("1:Yes");
5        System.out.println("2:No, return me back to menus");
6        Choice = Option.nextLine();
7        if (Choice.equalsIgnoreCase("1")) {
8            if (balance - amount - 5 <= -150) {
9                System.out.println("You have exceeded your Overdraft Limit, you will now be returned back to the menus");
10            } else { //if not exceeding bank balance
11                balance -= amount + 5;
12                System.out.println("You have withdrawen £" + amount);
13                System.err.println("You now have a balance of £" + balance);
14            }
15