CSC 222: Object-Oriented Programming
Spring 2017

Test 2 Review

Mon, Nov 13
  • 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
  • Click here for Sample Questions
Study advice
  • review online lecture notes
  • review the text book (if not mentioned in class, won't be on test)
  • look over quizzes, homework assignments
  • reference other sources for examples, different perspectives
Course material
    Object-oriented design
        classes & objects
        highly cohesive
            each class maps to a single, well-defined entity
            each method of the class maps to a single, well-defined behavior 
        loosely coupled
            each class is largely independent and interacts via well-defined interface
            method behavior should not depend upon coordination with other methods
    Java features
         data structures
            ArrayLists vs. arrays
            parallel lists vs. lists of structured objects 
                examples: WordFreq, UFOlookup, CityLookup
            interacting classes
        exception handling
            throwing an exception vs. try-catch
            Scanner class
                used to read from keyboard ( or a file (File object) 
                methods: hasNext, next, hasNextLine, nextLine, hasNextInt, nextInt, close, ...
            System.out.format, format string (e.g., %8s, %-8s, %.2f, %6.2f)
            generic interface/class, e.g., Comparable, ArrayList
            generic methods, e.g., Collections.reverse, Collections.sort
            defining & implementing an interface, polymorphism
            examples: Comparable, List
    Searching and efficiency
        sequential search vs. binary search
            worst case vs. average case vs. best case performance
            timing performance, System.currentTimeMillis
            applications: Dictionary, CityStats/CityLookup
        Big-Oh notation
            sequential search is O(N), binary search is O(log N)
            rate-of-growth behavior
    Sorting and recursion
            base case(s), recursive case(s)
            avoiding infinite recursion & redundancies 
            Dr. Seuss analogy
        insertion sort vs. selection sort vs. merge sort vs. quick sort
            worst case vs. average case vs. best case performance
            application: Dictionary class, lazy add approach    
        Big-Oh analysis
            insertion & selection sorts are O(N2), merge & quick sorts are O(N log N)
            rate of growth behavior