//Project 4 CST 112 //Abel Cruz String title = "Project Number 4"; String info= "Press key with first letter of a function ('?' for help; 'q' to exit"; String author = "Abel Cruz"; int [] num = {100, 23, 7, 11, 344, 630, 42, 26, 90, 57, 10}; int numbers= num.length; Button[] buttons; String buttonN[]={ "Big", "Small", "Add", "Minus", "Tripe", "Random" }; int amoButtons= buttonN.length; float horizon; void setup() { size (600, 500); horizon=height-75; makebuttons(); } void makebuttons() { buttons= new Button[amoButtons]; float x=10, y=horizon; for (int j=0; j a[w]) w=j; } int tmp; tmp= a[m-1]; // Save last element of array. a[m-1]= a[w]; // Store biggest at end. a[w]= tmp; } void small( int a[], int m ) { // Move the smallest number to the beginning of the array // (Swap, to keep all numbers.) int w=0; for (int j=1; j x+w) return false; if (yy < y) return false; if (yy > y+h) return false; return true; } } void mousePressed() { if ( buttons[0].click(mouseX, mouseY) ) { big( num, numbers ); return; } if ( buttons[1].click(mouseX, mouseY) ) { small( num, numbers ); return; } if ( buttons[2].click(mouseX, mouseY) ) { inc( num, numbers ); return; } if ( buttons[3].click(mouseX, mouseY) ) { dec( num, numbers ); return; } if ( buttons[4].click(mouseX, mouseY) ) { triple( num, numbers ); return; } if ( buttons[5].click(mouseX, mouseY) ) { randomize( num, numbers ); return; } }