Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to code the overdraft limit in Java

    if (balance - amount - 5 < 0) {
        System.out.println("Insufficent funds");
        System.out.println("Would you like to apply for an ovedraft?");
        System.out.println("1:Yes");
        System.out.println("2:No, return me back to menus");
        Choice = Option.nextLine();
        if (Choice.equalsIgnoreCase("1")) {
            if (balance - amount - 5 <= -150) {
                System.out.println("You have exceeded your Overdraft Limit, you will now be returned back to the menus");
            } else { //if not exceeding bank balance
                balance -= amount + 5;
                System.out.println("You have withdrawen £" + amount);
                System.err.println("You now have a balance of £" + balance);
            }
Comment

PREVIOUS NEXT
Code Example
Java :: how to explicitly declare an array java 
Java :: java window always on top 
Java :: Java labeled break Statement 
Java :: Java Using range(e1, e2) Method 
Java :: hide frame ( acces to the top level component ) 
Java :: java tester si un caractere est une lettre 
Java :: es java painless source int value increase 
Java :: Enlist Operations in ComboBox (Addition, Subtraction, Division, Multiplication in java 
Java :: Save SQLite returned data to an object list 
Java :: minecraft 21w14a bugs 
Java :: java optional input for funktions 
Java :: fix intellij resetting the java version everytime you add a dependency 
Java :: Java Copying Arrays Using Assignment Operator 
Java :: Description Resource Path Location Type ApplicationContext cannot be resolved to a type Mobile.java /InversionOfControl/src/com/deloitte/springioc line 13 Java Problem 
Java :: minecraft java plugin shift 
Java :: java manajro 
Java :: spring boot rest api 
Java :: android java sqlite alter table 
Java :: How authentication manager works in spring security 
Java :: Java Multiple element Annotations 
Java :: kotless scheduled event 
Java :: Copying Arrays Using arraycopy() method Java 
Java :: /= java 
Java :: is java pass by value or pass by reference 
Java :: android array to string 
Java :: casting in java 
Java :: java calling a method 
Java :: android get id of view 
Java :: how to convert integer to list in python 
Java :: getUssd() kotlin 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =