Skip to content
Snippets Groups Projects
exam-paper.tex 2.57 KiB
\documentclass[addpoints,12pt]{exam}
\usepackage{strath-exam}
\usepackage{setspace}
\usepackage{lipsum} % For demonstration only.

%----------------------------------------
% The footer.
%----------------------------------------
\footer{{\bf \small CSxxx}}{\iflastpage{}{\bf{PLEASE TURN OVER}}}{{\bf \small Page \thepage\ of \numpages}}

%----------------------------------------
% Page colour.
%----------------------------------------
\definecolor{bananamania}{rgb}{0.98, 0.91, 0.71}
%\pagecolor{bananamania}  % Uncomment for "yellow" background.

%----------------------------------------
% Solutions.
%----------------------------------------
\printanswers % Comment out to hide the model answers.
\unframedsolutions % Disable the solution box.
\renewcommand{\solutiontitle}{\noindent\textbf{Solution}\par\noindent} % "Solution" above.
\SolutionEmphasis{\color{red}} % The solution text colour

\begin{document}

%----------------------------------------
% Preamble information.
%----------------------------------------

\dept{Computer \& Information Sciences}

\vspace*{5mm}

\class{CSxxx\quad Software Engineering}

\vspace*{5mm}

\examdate{19th April 2021}{09:30\,-\,12:30}{3 hours}

\vspace*{5mm}

\preamble{Attempt THREE questions.}

%----------------------------------------
% Set the line spacing.
%----------------------------------------
\setstretch{1.0}

%----------------------------------------
% The questions.
%----------------------------------------
\begin{questions}

\question[2] Is it true that \(x^n + y^n = z^n\) if \(x,y,z\) and \(n\) are positive integers?. Explain.

\droppoints
\vspace{48pt}

\question[10] Prove that the real part of all non-trivial zeros of the function \(\zeta(z)\) is \(\frac{1}{2}\)

\droppoints
\vspace{48pt}

\clearpage
\newpage

\question[4] Compute \[\int_{0}^{\infty} \frac{\sin(x)}{x}\]

\droppoints

\begin{solution}
The solution.  \lipsum[1]
\end{solution}

\vspace{48pt}


\question
A question with several parts.
\begin{parts}
\part[3]
The first part.

\droppoints

\part[4]
The second part.

\droppoints
\end{parts}

\vspace{48pt}

\question[15]
A long question, using lipsum for demonstration.  \lipsum[2-4]

\droppoints
\vspace{48pt}

\question[10]
Discuss the code below.

\begin{lstlisting}[language=python]
import random

def roll_dice(n_dice, n_sides):
    total = 0
    for i in range(n_dice):
        total += random.randint(1, n_sides)
    return total
\end{lstlisting}

\droppoints
\vspace{48pt}

\end{questions}

%----------------------------------------
% The signature.
%----------------------------------------
\sig{Prof. E.~X.~A.~M. Setter}

\end{document}