\documentclass[11pt]{exam}
\usepackage{listings}
\usepackage{pdfsync}

%
%  Created by Nancy Ide on 2008-12-10.
%  Copyright (c) 2008 __MyCompanyName__. All rights reserved.
%
%

% This is now the recommended way for checking for PDFLaTeX:
\usepackage{ifpdf}


%\newif\ifpdf
%\ifx\pdfoutput\undefined
%\pdffalse % we are not running PDFLaTeX
%\else
%\pdfoutput=1 % we are running PDFLaTeX
%\pdftrue
%\fi

\ifpdf
\usepackage{subfigure}
\usepackage[pdftex]{graphicx}
\else
\usepackage{graphicx}
\fi
\usepackage{enumerate}

%
%  Update these values for headers
%
\header{CS240\\Assignment 1}{}{YOUR NAME\\ \thepage \ of \numpages}

\begin{document}

% Questions start here:
\begin{questions}

\question
Here is a question about a string $x$ with length $n \ge 0$.

\noindent
{\bf Answer:}

My answer appears here.

\question
Here is a question about FAs recognizing the following languages over $\Sigma = (a,b)$.
\begin{enumerate} [a.]
\item $\{w | w $ contains at least three $a$Ős\}.
\item $\{w | w $ starts with an $a$ and has odd length\}.
\end{enumerate}

\noindent
{\bf Answer:}

\begin{enumerate} [a.]
\item My answer to part (a) appears here.

\item My answer to part (b) appears here.
\end{enumerate}

\end{questions}
\end{document}


