CS 101: 12/1/11 Tonight: Project 4 is due word1 = cropSound (s, 22050, 44100); word2 = cropSound (s, 48050, 53900); word3 = cropSound (s, 67000, 109000); Sound final; final = joinSounds (word1, word2); final = joinSounds (final, word3); final = joinSounds (final, word4); final = joinSounds (final, word5); final = joinSounds (final, word6); Final Exam: Wednesday 12/7/11 at 10:30 am in LC-C6 Format will be the same at exam 1 & 2. 20 multiple choice questions 2 write code questions No Turtle or picture related questions Sound Information Java Control Structures Java Arrays x = 30; z = 0; if (x > 25) z = 1; else if (x > 15) z = 2; else if (x > 5) z = 3; else z = 4; z will be 1 at the end x = 30; z = 0; if (x > 5) z = 1; else if (x > 15) z = 2; else if (x > 25) z = 3; else z = 4; z will be 1 at the end x = 30; z = 0; if (x > 5) z = 1; if (x > 15) z = 2; if (x > 25) z = 3; else z = 4; z will be 1 at the end x = 0; y = 0; z = 0; for ( x = 0 ; x < 3 ; ++x) { for (y = 0 ; y < 3 ; ++y) { z = x + y + z; System.out.println ("X: " + x + ", Y: " + y ); } System.out.println ("X: " + x + ", Y: " + y ); } System.out.println ("X: " + x + ", Y: " + y ); x 0 0 0 0 1 1 1 1 2 2 2 2 3 y 0 1 2 3 0 1 2 3 0 1 2 3 3 arrays questions: int arr[] = new array [10]; for (x = 0 ; x < array.length ; ++x) arr[x] = x * 3; //pos: 0 1 2 3 4 5 6 7 8 9 //val: 0 3 6 9 12 15 18 21 24 27 for (x = 3 ; x < array.length ; x = x + 3) arr[x] = arr[x-1] + arr[x-2]; //pos: 0 1 2 3 4 5 6 7 8 9 //val: 0 3 6 9 12 15 27 21 24 45 Instructor : Pat Troy Dept: CS Course CS 101 Call 10621 year: 2011