Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int [] onderVerdelen() {
- int [] cijferlijst = new int[10];
- for (int i = 0; i <cijfers.length; i ++) {
- for (int j = 1; j <10; j++) {
- if (cijfers[i] <=1) {
- cijferlijst[0]++;
- } else if (cijfers[i] >j && cijfers[i] <=j+1) {
- cijferlijst[j]++;
- }
- }
- }
- //println(cijferlijst);
- return cijferlijst;
- }
- void tekenGrafiek() {
- int [] cijferlijst = onderVerdelen();
- printArray(cijferlijst);
- float counter = 0;
- for (int i =0; i < 11; i++) {
- stroke(#000000);
- fill(#FFFFFF);
- }
- for (int l = 1; l <=10; l++) {
- for (int k = 0; k< cijferlijst.length; k++) {
- if (cijferlijst[k] > l-1 && cijferlijst[k] <=l) {
- printArray(cijferlijst[k]);
- counter++;
- }
- }
- rect(marge+(((width - marge *2)/10)*(l-1)), height-(marge-2), (width-marge*2)/10, -1000*(counter/cijferlijst.length));
- counter = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement