\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{cs1102sfinal}
              [2001/07/28 v1.0; final for CS1102S]

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}

\ProcessOptions

\LoadClass{article}

\usepackage{fancybox}
\usepackage{alltt}
\usepackage{color}

\input slidepreamble

\newcommand{\ps@exam}{%
\renewcommand{\@oddhead}{CS1102S \hfil \textrm{\thepage}}%
\renewcommand{\@evenhead}{\@oddhead}%
\renewcommand{\@evenfoot}{}%
\renewcommand{\@oddfoot}{\@evenfoot}}

\pagestyle{exam}

\newcounter{questioncounter}
\setcounter{questioncounter}{0}
\newcounter{altcounter}

\newenvironment{question}{%
\addtocounter{questioncounter}{1}
\vspace{10mm}
\textbf{Question \thequestioncounter}:}% 
{}

\newenvironment{answer}{%
\vspace{20mm}
%\color{white}
\textbf{Answer}:
}% 
{
\color{black}
}


\newenvironment{alternatives}{%
\setcounter{altcounter}{1}
\begin{itemize}}%
{
\end{itemize}}

\newcommand{\Item}{\item[\thequestioncounter\ \Ovalbox{\Alph{altcounter}}]
\addtocounter{altcounter}{1}
}

\ProcessOptions

\parindent 0pt

%\setlength{\voffset}{-30mm}
\setlength{\textheight}{650pt}
%\setlength{\textwidth}{240mm}
\setlength{\textwidth}{145mm}
\setlength{\oddsidemargin}{10mm}

\AtBeginDocument{%

\thispagestyle{empty}

\begin{center}
\bf
{\large NATIONAL UNIVERSITY OF SINGAPORE}
\vspace{5mm}

{\large SCHOOL OF COMPUTING}

{\large EXAMINATION FOR}
\vspace{5mm}

{\large SEMESTER 2 2009/2010}
\vspace{5mm}

{\large CS1102S---Data Structures and Algorithms}
\vspace{15mm}

{\large May 2010} \hspace{30mm} {\large Time Allowed: 2 Hours}

\end{center}

\vspace{10mm}

\hrule

\vspace{10mm}

{\large \textbf{INSTRUCTIONS TO CANDIDATES}}
\vspace{5mm}

\noindent

{\large This is an open book examination. Any written and printed
material may be used during the examination. 

\vspace{4mm}
Please observe the following items:

\begin{enumerate}
\item Enter your matriculation number here:\ 
{\LARGE
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}
\hline
\ \ &\  \ &\  \ &\  \ &\  \ &\  \ &\   \ &\  \ \\
\hline
\end{tabular}
}

\item Enter the answers to the questions in this
answer book in the provided spaces.
\item This examination booklet has 10 pages, 
including this cover page, and contains 7 questions.
\item Answer all questions.
\item The maximal marks achievable is indicated for each question.
Overall, the maximal number of marks is 83.
\end{enumerate}

\begin{center}
{\bf{\large Good Luck !}}
\vspace{15mm}

\hrulefill\ {\bf Do not write below this line}\ \hrulefill

\vspace{15mm}

{\Large
\begin{tabular}{|c|c|c|c|c|c|c|c|c||c|}
\hline
Question & \ 1 \ &\  2 \ &\  3 \ &\  4 \ &\  5 \ &\  6\ &\  7\  &  Total\\ \hline
Maximal Score & 11  & 14  & 11  & 9  & 12 & 11 & 15 & 83  \\ \hline
Student Score &     &    &     &    &    &    &   & \\
\hline
%             26    9    15    9    10   11   8   12
%              5    3     4    3    3    3    3   3  -> 26
\end{tabular}
}
\end{center}

\newpage

}
}

