CSC151 2007S, Class 07: Characters and Strings Admin: * Any announcements of events your colleagues should attend? * Any questions on HW4? * Reading for Friday: Procedures. * Email fixes on Friday. Overview: * Additional lessons from yesterday. * Short introduction to strings. * Lab. /On Numeric Procedures/ * What is a parameter (argument, operand) * When you write (OPERATOR EXP EXP EXP) it's the name we use for the expressions * remainder * How many parameters (argument, operand)? * Two * What types? * Integers, the second of which is NOT 0 * Computes what's left over after you divide the first expresssion by the second * What if a parameter is negative? (remainder 10 -3) (remainder -10 3) (remainder -10 -3) * The sign of the remainder is the same as the sign of the dividend. * modulo * Sam claims (with no supporting evidence) that it's similar to remainder * How? Ttat sign thing * Gives "the same answer", at least when both numerator and divisor are positive. * How does it differ from remainder? * max * How many parameters? * What types? * lcm * How many parameters? * What types? /Additional learning outcomes (or so Sam hopes)/ * You need to think carefully about what a procedure does. * Esp. important when you define your own. * But hey, even your TA screws up. * But try, anyway ("Hey, what happens if I use a negative nubmer/0/something else weird") /Where to put answers/ * Defniitions pane * Can be saved. * Interactions pane * Students hate the definitions pane + Takes longer + No "Escape-P" + Gets cluttered. /Notes on Characters and Strings/ * None! /Lab!/ * Why do we worry about collating sequences? * To avoid ambiguity!