Advertisement
HaloReach

Untitled

Oct 10th, 2015
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.90 KB | None | 0 0
  1. int [] onderVerdelen() {
  2.   int [] cijferlijst = new int[10];
  3.   for (int i = 0; i <cijfers.length; i ++) {
  4.     for (int j = 1; j <10; j++) {
  5.       if (cijfers[i] <=1) {
  6.         cijferlijst[0]++;
  7.        } else if (cijfers[i] >j && cijfers[i] <=j+1) {
  8.         cijferlijst[j]++;
  9.       }
  10.     }
  11.   }
  12.   //println(cijferlijst);
  13.   return cijferlijst;
  14. }
  15.  
  16. void tekenGrafiek() {
  17.   int [] cijferlijst = onderVerdelen();
  18.   printArray(cijferlijst);
  19.   float counter = 0;
  20.   for (int i =0; i < 11; i++) {
  21.     stroke(#000000);
  22.     fill(#FFFFFF);
  23.   }
  24.   for (int l = 1; l <=10; l++) {
  25.     for (int k = 0; k< cijferlijst.length; k++) {
  26.       if (cijferlijst[k] > l-1 && cijferlijst[k] <=l) {
  27.         printArray(cijferlijst[k]);
  28.         counter++;
  29.       }
  30.     }
  31.     rect(marge+(((width - marge *2)/10)*(l-1)), height-(marge-2), (width-marge*2)/10, -1000*(counter/cijferlijst.length));
  32.     counter = 0;
  33.   }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement