\documentclass[12pt]{article}
\usepackage[usenames]{color}
\usepackage{fancyvrb}
\usepackage{colordvi}
\usepackage{epic, eepic}
\usepackage{tikz}
\usepackage{exam}
\usepackage{times}
\usepackage{alltt}
\usepackage{enumerate}
\usepackage{xcomment}
\usepackage{mathpartir}
\usepackage{setspace}
\usepackage{algorithm,algorithmic}

% Only needed for demonstration.
\usepackage{lipsum}

\newenvironment{soltt}{\begin{xcomment}{document}}{\end{xcomment}}
\renewcommand{\familydefault}{\sfdefault}

\begin{document}

% When the paper has been written, the number of pages needs to be 
% provided, instead of 11.  (It should be possible to solve this 
% properly with lastpage.)
\pagetot{CSxyz}{11}

\vspace*{-0.3cm}

%%%\newcommand{\solflag}{1} %%% remove %%% from start of line to make answers
\ifx\solflag\undefined
  \newcommand{\sol}[1]{}
  \newcommand{\solonly}[1]{}
\else
  \newcommand{\sol}[1]{\vspace*{-0.05in}\textit{#1}\vspace*{-0.2in}}
  \newcommand{\solonly}[1]{#1}
\fi

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

\class{CSxyz\quad Anti-Engineeering Methods}
\vspace*{-0.2cm}

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

\vspace*{-0.5cm}

\preamble{Attempt THREE questions.}

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

% Some students require linespacing of 1.5 or 2.0.  By default,
% the setstretch can be 1.0.

\input{exam-questions}

\sig{Prof. E.~X.~A.~M. Setter}

\end{document}