CS 101 Notes 3/30/2010 Exam 2 on Tuesday 4/6/2010 during class. 20 multiple choice questions 2 write code questions. Topics: If statements, relational operators > >= < <= == != boolean operators && || ! while loops and for loops Methods and parameters picture manipulation stuff Boolean question example x = ; y = ; z = ; if (x > y && z < 10) x = x + 5; if (z < y || x > 10) y = x + z; if ( z < y && x > z && y != x) if ( z < y && (x > z || y != x)) Which of the following conditional expressions is true when the value x in in the range from 5 to 15 (inclusive)? (x > 15 || x < 5) (x <= 15 && x >= 5) (5 <= x <= 15) (x == 5 || x == 6 || x == 7 || ... || x == 15) While of the following evaluate to true? (x < 10 && y >= 8 && z <= -4) What is the truth table for AND? x y | X && y X || y !x ================================= t t | t t f t f | f t f f t | f t t f f | f f t Pictures have 2 dimensions Sound has 1 dimension Movies have 3 dimensions With sound, we digitize the amplitude of a sound wave. The number represents the position above or below the base line in the sound wave. The numbers range from +32,767 to -32,768 0 - 255, 256 different values 2^8 The sound has 65,000+ different value = 2^16