Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to not allow a user to enter a mark greater than 100 or below 0 in java

    int[] cw_Mark = new int[6];
    for (int i = 0; i < cw_Mark.length; i++) {
        if (i >= 0 || i <= 100) {
            System.out.println("Please Enter Your Module " + (i+1) + " Coursework Mark: ");
            cw_Mark[i] = input.nextInt();
        } else {
            System.out.println("Please Enter a Number Between 1 and 100");
        }
    }
Comment

PREVIOUS NEXT
Code Example
Java :: Java (HotSpot 12) sample 
Java :: java list to jsonelement 
Java :: jaspersoft masking 
Java :: last resultset method 
Java :: how to reinstall nginuity 
Java :: RTC_WAKEUP 
Java :: how to know when user is done typing android 
Java :: efficient generic duplicate finding class java 
Java :: java-util of geofence polygon 
Java :: java switch case enum 
Java :: find largest number in 2d array java 
Java :: cannot find symbol final TextView textView = root.findViewById(R.id.text_home); 
Java :: java.applet defines how many interfaces 
Java :: OkHttp3 Never Timeout on slow internet 
Java :: Copying Arrays Using Assignment Operator Java 
Java :: use scanner class in global scope java 
Java :: txt not chnage on fragment 
Java :: spigot scoreboard objective 
Java :: jsonobject add key value java 
Java :: How do you use both Spring Data JPA and Spring Data Elasticsearch repositories on the same domain class in a Spring Boot application? 
Java :: Repeat execution of function infini android studio 
Java :: edit xmlns attribute with jaxb marshaller 
Java :: Encrypt words facebook 
Java :: For loop in selenium java li 
Java :: menuitemcompat getactionview is deprecated in android 
Java :: java declared fields vs fields 
Java :: also in java 
Java :: Enlist Operations in ComboBox (Addition, Subtraction, Division, Multiplication in java 
Java :: ant bild skip java doc 
Java :: java loop aray 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =