\documentclass{ueaexam}% final version
 %\documentclass[draft]{ueaexam}% Draft version
 %\documentclass[solutions]{ueaexam}% Solution sheet
 %\documentclass[solutions,watermarkfirst]{ueaexam}% Solution sheet watermark only on first page
 %\documentclass[draft,solutions]{ueaexam}% Draft solution sheet
 %\documentclass[noscorecheck]{ueaexam}% Don't check score totals

\usepackage{verbatim}

 % DON'T change \score to change the format of the marks,
 % instead change \scoreformat or \marklabel

 % e.g.:
 %\renewcommand{\marklabel}[1]{#1\%}
 %\renewcommand{\scoreformat}[1]{\hfill\emph{[\marklabel{#1}]}}

 % DON'T try redefining \mark or \marks as they are TeX and eTeX
 % primitives! Messing around with primitives will make your
 % document unstable.

 % Set the total score for each question
\questiontotal{24}

 % Exam version number
\version{1}

 % Contact
\contact{Dr A.N. Other, CMP}

 % Scores may be decimal e.g. \score{2.5} or comma-separated
 % e.g. \score{2,2}

 % \section may occur inside enumerate environment

\course{CMPS5C88}{Problem Solving}
\sitting{UG Reassessment/Delayed First Sit}
\timeallowed{4 hours}
\rubric{%
  Separate answer books should be used for each section.
}

\begin{document}
\maketitle % <- always include \maketitle or you'll get an error

 % Initial \section should go outside enumerate environment.
 % All the other \section commands may go inside enumerate
 % environment.
\section{2}

\begin{enumerate}
 % Put all questions inside single enumerate environment

\item Present an architecture for a simple mainframe, explaining the purpose of the little lights on the front. \score{12}

\Solution{This is the solution to the question. It will only appear
if class option ``solutions'' is used.}

Illustrate your answer by describing in terms of fetch-execute cycles the execution of a small accounting package.\score{12}

\item Write a ``Hello World'' program in Java.\score{24}

\Solution{\verbatiminput{sample-code.java}}

\item A Boolean function $F$ is given by
\[F = A v B\]

Give an expression for $F$ in its simplest form.\score{2}

 Now spend half an hour wondering why this question is so much easier than all the others, and trying to work out what you have missed. \score{22}

\item A self-starting two-up two-down JK flip-flop asynchronous decade ripple counter is required. Discuss.\score{24}

\item Explain the operation of a NAND gate in each other following technologies:\\

TTL,DCTL,DTL,DTDCLT,McDLT,CMOS,NMOS,ECL,I2L,MC2\\

\phantom{123}\score{8}

\begin{enumerate}
\item Which one causes there to be slightly more electron-positron pairs in the valence band? \score{8}
\item Given that you're meant to be doing a Computer Science and not a Physics degree, does it really matter?\score{8}
\end{enumerate}

\section{1}

\item
Explain what is meant by a stream (or lazily evaluated list). \score{20}

Show how streams can be used in ML with monotonous regularity to produce examination questions.\score{4}

\item
 Show how higher order functions can be used in ML to model
 \begin{enumerate}
\item  the natural numbers. \score{2}

\item  the fission process inside a nuclear reactor. \score{12}

 \item  just about anything you care to mention.\score{10}
 \end{enumerate}

\section{all}

\item State the principal of mathematical induction.\score{5}

Use induction on the question numbers on this paper to show that the fact that you can't do the first question means that you probably won't be able to do any of the others either.\score{19}
\item Show that there is no known algorithm for answering exam questions.\score{12}

Deduce that you are wasting your time trying.\score{12}

\item This bit comes in two parts in the same paragraph:
\begin{textenum}
\item first part,
\item second part.
\end{textenum}
\score{11.5,12.5}

\section{the}

\item
  Answer this question.
  \begin{enumerate}
  \item \label{q:samplefig}Analyse Figure~\ref{fig:sample} and draw a related
image.\score{12}

  \begin{figure}
    \centering
    \Huge X
    \caption{Image for Question~\ref{q:samplefig}}
    \label{fig:sample}
  \end{figure}

  \Solution{It's a big X. Related image shown in
    Figure~\ref{fig:sample-ans}.

  \begin{figure}
    \centering
    \Huge
    Y
    \caption{Solution Image for Question~\ref{q:samplefig}}
    \label{fig:sample-ans}
  \end{figure}}

  \item \label{q:sampletab}Analyse Table~\ref{tab:sample} and write
another table.\score{12}

  This bit of the question has a bullet-point list:

  \begin{itemize}
  \item first item.
  \item second item
  \end{itemize}

  \begin{table}
    \caption{Table for Question~\ref{q:sampletab}}
    \label{tab:sample}
    \centering
    \begin{tabular}{cc}
    A & B\\
    1 & 2
    \end{tabular}
  \end{table}

  \Solution
  {
    It's a table with two rows and two columns. Another table shown
in Table~\ref{tab:sample-ans}.

    \begin{table}
    \caption{Solution Table for Question~\ref{q:sampletab}}
    \label{tab:sample-ans}
    \centering
    \begin{tabular}{cc}
    A & 1\\
    B & 2
    \end{tabular}
    \end{table}
  }
  \end{enumerate}

\end{enumerate}

\end{document}

