CSC152 2005F, Class 25: Review of Control Structures Admin: * Questions on the homework? Overview: * A motivating problem: Parsing to integers * Conditionals * Loops * Exceptions String equality testing str.equals(otherString) Hard part: How do you convert a string that is a sequence of digits to an integer? Suggestion one: Start at the right, extract each digit, and multiply by the place value E.g., "4218" There's an 8 in the rightmost place, 8*1 = 8 There's a 1 in the next place, 1*10 = 10 ... 4000 + 200 + 10 + 8 = 4218 Concern about potential overflow Alternative: * Take the first digit * Recurse on the rest * Combine somehow