CSC 221: Computer Programming I
Test 2 Review

Thu, Nov 19
  • The test will include extra points (Mistakes Happen!), e.g., 52 or 53 points, but graded on a scale of 50.
Types of questions
  • factual knowledge: TRUE/FALSE, multiple choice
  • conceptual understanding: short answer, discussion
  • synthesis and application: explain/debug code, trace/modify code
Study advice
  • review online lecture notes (if not mentioned in class, won't be on test)
  • review text
  • look over quizzes, homework assignments
  • reference other sources for examples, different perspectives
Course Material
Conditionals and expressions
  if statement, if-else
      increment/decrement, arithmetic assignments
      mixed expressions
      type casting
  abstraction & modularization
      internal vs. external method calls
      primitives vs. objects 
Interaction and repetition
  modular design
      constant fields (final & static)
      shared fields (static)
  while loops 
      controlled by boolean expression, condition-driven
      logical operators (&&, ||, !), remainder operator (%)
      danger: infinite (black-hole) loops
  variable scope
      nesting loops & conditionals, cascading if-else
      variables local to if/while block
  for loops
      used for counter-driven applications
      equivalent to while loops
  simulations: dice, dot race, volleyball

Class design and strings
  highly cohesive
      each class/method maps to a single entity/behavior
  loosely coupled
      classes are largely independent, interact via methods
      strings as objects
      comparison using equals and compareTo
      methods: length, charAt, substring, indexOf, toUpperCase, toLowerCase
      Character static methods: isUpperCase, isLowerCase, isLetter, ...
      StringUtils static methods: capitalize, reverse, stripSpaces, pigLatin, ...