Midterm Prep Guide

What Should You Expect?

  • The exam is pencil-and-paper. You may not use a computer.
  • The exam will be self-contained. You will not be asked to recall any specific problem from homework or labs.
  • You will not be expected to write much code on the exam. You may be asked to write interfaces and (abstract) classes (fields and constructors). You will not be asked to write large methods. You may be asked to fill in the blanks in a partially-written method.
  • You will not be graded on the details of Java syntax. You should know what info goes where (i.e., where fields go, what goes into each of interfaces and classes, how to distinguish abstract classes from non-abstract classes). You will not lose points for a missing semicolon, unbalanced braces, or other minor details as long as indentation/punctuation makes it clear what goes where.

What You Can Bring

You may bring a single sheet of paper with whatever notes, examples, comments, etc that you wish. You may use both sides of the paper. Typeset or handwritten is fine. The exam is otherwise closed-book, closed-notes.

You may not share paper notes with others during the exam.

What You are Expected to Know

The exam will focus on the higher-level concepts we have covered so far, such as how to organize programs in Java and how to work effectively with data structures. The exam will cover all material through lecture on Friday, November 11. Specifically, you are expected to know:

  • The difference between classes and objects
  • When to create each of classes, abstract classes, and interfaces
  • The differences between classes, abstract classes, and interfaces
  • How the type you put on a field or piece of data affects which parts of an object Java will let you access
  • When you create nested objects and associate names with objects, how many objects exist "under the hood" and how are they connected (through fields and known names)
  • How to write programs that process lists
  • How to identify the (sub)tasks in a programming problem
  • How to write test cases for a method

Exams from Previous Offerings

The order of material changed in the course this year, so several topics covered on previous midterms won't be part of yours (and material on the "under the hood" layout does not appear on previous exams). Check the listing with each exam below as to which questions you should be able to do at this point.

I have included exam answers when I have them.

Exams prior to D-term 15 were using a different grading system then we are this term. Ignore the grading aspect of the earlier exams.

  • midterm from B-term 2015: you should be able to do problems 2 and 3. the material for question 1 is not covered on your midterm.
  • midterm from D-term 2015: you should be able to answer question 2, except for part b item ii (about privates) -- you can ignore the private annotations; the material for questions 1 and 3 is not covered on your midterm. I don't have solutions written out for this exam
  • midterm from B-term 2012: you should be able to answer questions 2a and 2b; the material for questions 1, 2c and 3 is not covered on your midterm. Solutions to this exam (ignore the stuff that fills in the blanks in question 2 -- we haven't covered that material yet)
  • midterm from B-term 2010: you should be able to answer question 1 from this exam; the material from questions 2 and 3 is not covered on your midterm. I don't have solutions written out for this exam

Literal Instructions from First Page of Exam

You have 50 minutes to complete the problems on the following pages. There should be sufficient space provided for your answers.

If a problem asks you to create a class hierarchy, we are looking for the interfaces, classes, and abstract classes that you would create for the problem. In particular:

  • Include implements and extends statements
  • Include field names and types
  • Include method headers (names, return type, and input parameter types)
  • Full credit requires that all types and implements/extends relationships are clear. Be sure your work is clear if you use class diagrams instead of Java syntax.
  • You may omit constructors
  • You may omit method bodies unless a question asks otherwise
  • You may omit the Examples class (examples of data and test cases) unless a question asks otherwise