WED CompSci 2/25

Exam Overview

  • The exam is scheduled for tomorrow during the lab session.

  • Duration: Two hours to complete the exam.

  • Format: It will be a paper-based exam, similar to in-class assignments, utilizing Scantron for multiple-choice questions.

  • It will include short answer questions in a separate packet.

Exam Content

  • Topics Covered: Everything learned so far except linked lists.

Key Topics To Study:

1. Enumerated Types
  • Ability to write an enumerated type.

  • Understand the following methods:

    • values(): retrieves all iterator values.

    • equals(): checks for object equality.

    • toString(): returns string representation.

    • ordinal(): retrieves position of the enum constant.

2. Arrays
  • Proficiency in manipulating arrays, especially:

    • Two-dimensional arrays.

    • Jagged arrays.

  • Ability to trace methods and write small methods, similar to in-class assignments and maze game methods.

3. Big O Notation
  • Understand the formula to estimate run time based on input size.

    • Formula: f(size2)f(size1)×answer1\frac{f(size2)}{f(size1)} \times answer1

    • Ability to estimate time complexities based on given values:

    • Example Calculation:

      • Suppose size1=100size1 = 100 and answer1=250answer1 = 250 with size2=1000size2 = 1000.

      • For O(n)O(n) complexity, the calculation becomes:
        1000100×250=2500\frac{1000}{100} \times 250 = 2500

  • Know how to analyze method complexity based on loops and iterations.

  • Understand common complexities (e.g., linear, quadratic, cubic).

4. Exceptions
  • Familiarity with try-catch blocks and their structures.

    • Distinction between checked and unchecked exceptions:

    • Checked: Must be handled or declared to be thrown.

    • Unchecked: Generally runtime exceptions, can be handled but not required.

  • Review the inheritance tree of exceptions to determine their types.

5. Object Class
  • Understand the significance of the Object class as the superclass of all classes.

  • Familiarity with inherited methods, specifically:

    • clone() method, its implications regarding shallow vs deep clones.

  • Recognition of quality reference equality vs content equality.

6. Data Structures (Array Bags)
  • Knowledge of underlying designs for IntArrayBag and DoubleArraySeq.

  • Ability to interpret internal structures and behaviors after calls to methods like add or remove:

    • Understand what the underlying array looks like after certain operations.

7. Inheritance
  • Comprehension of superclass, subclass relationships.

  • Ability to interpret UML diagrams representing class relationships.

  • Knowledge of how casting operates within inheritance.

    • Widening and Narrowing:

    • Widening: Assigning a subclass object to a superclass (e.g., Teacher to Person).

    • Narrowing: Assigning a superclass object to a subclass (with potential casting).

Exam Preparation Tips

  • Review previously graded homework and quizzes.

  • Focus on homework questions similar to expected exam questions.

  • Utilize the study materials and the dedicated exam section on the As You Learn platform.

  • Cheat Sheet Allowed: One 8.5 x 11-inch paper, front and back, allowed for the exam. Material may include formulas, notes on exception types, and any relevant code snippets.

Additional Points

  • No GUI content will be tested; focus on foundational programming concepts.

  • Final preparations should include clarifying any remaining doubts with the instructor.

  • Engaging resources include class slides and practical assignments to consolidate learning.

  • Be familiar with handling exceptions and the use of instance checking within the context of casting objects.

  • Review all relevant class structures and inheritance thoroughly for a firm examination readiness.