daily pastebin goal
9%
SHARE
TWEET

Untitled

a guest Mar 20th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. double[] aboveLimit = new double[list2.length];
  2. double limit; //set limit variable
  3. int j = 0;
  4. for(int i = 0;i < list2.length;i++) {
  5.   if(list2[i] > limit) {
  6.     aboveLimit[j] = list2[i];
  7.     j++;
  8.   }
  9. }
  10.  
  11. for(int i = 0;i < aboveLimit.length;i++) { //checks when reached end of all numbers
  12.     if(aboveLimit[i] == 0) {
  13.         if(i == 0) {
  14.             break; //if there are no numebrs greater than the limit, nothing happens
  15.         }
  16.         else {
  17.             System.out.println(" are above the limit.");
  18.             break;
  19.         }
  20.     }
  21.     else {
  22.         System.out.println(aboveLimit[i] + ", ");
  23.     }
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top