\documentclass[12pt]{article}
%\usepackage[instructions]{exam}
\usepackage[solution,boxanswers]{exam}
\title{Example Final Examination \\ Computer Science 999}
\date{December 31, 2003}

\begin{document}
\maketitle

\ifinstructions
Before starting the exam, write your name on this page.

There are~\ref{lastprob} problems on this exam. It is~\pageref{lastpage}
pages long; make sure you have the whole exam. You will have 50 minutes
in which to work on the problems. You will likely find some problems
easier than others; read all problems before beginning to work, and
use your time wisely.  The prelim is worth \totalpts{} points total.
The point breakdown for the parts of each problem is printed with the
problem. Some of the problems have several parts, so make sure you do
all of them!

This is an closed-book examination; you \textbf{may not} use outside materials,
calculators, computers, etc.

Do all written work on the exam itself. If you are running low on
space, write on the back of the exam sheets and be sure to write
(OVER) on the front side. It is to your advantage to show your work
--- we will award partial credit for incorrect solutions that are
headed in the right direction. If you feel rushed, try to write a
brief statement that captures key ideas relevant to the solution of
the problem.

\vspace{2in}

Name \hrulefill

\np
\pagestyle{myheadings}
\markright{Name~\hrulefill}

\begin{center}
\scorebox
\end{center}
\fi

\begin{questions}
 \question{True/False}{20} (\showparts)
  \begin{tfparts}
   \newpart{5} Grass is green. % try changing point value to 4!
    \tfans{True}
   \newpart{5} Emacs is better than vi.
    \tfans{False}
   \newpart{5} $2+2=4$
    \tfans{True}
   \newpart{5}\label{difficult} This exam is difficult.
    \tfans{False}
  \end{tfparts}

 \question{Short answer}{40} (\showparts)
  \begin{parts}
   \newpart{20}
    What is the air-speed velocity of an unladen swallow?
    Explain.
    \begin{answer}{2}
      What do you mean? An African or European swallow?
    \end{answer}
   \end{parts}
  The next two question parts are less interesting; however, notice that this
  explanatory text is not part of any question part.
  \begin{parts}
   \newpart{10}
    What is your name?
    \begin{answer}{1}
    Arthur
    \end{answer}
   \newpart{10}
    What is your favorite color?
    \begin{answer}{1}
    Blue
    \end{answer}
  \end{parts}
 \question{Essay}{40}

  Identify the movie containing the line, ``Describe, in
  single words, only the good things that come into your mind about your
  mother,'' and explain the significance of the question.
  \begin{answer}{3}
    One word: ``replicant''
  \end{answer}
\end{questions}

\label{lastpage}
\end{document}
