\documentclass[noanswers,addpoints,10pt,x11names]{exam}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{xcolor}
\usepackage[most]{tcolorbox}
\usepackage{datetime}
\usepackage{enumerate}
\usepackage{xltxtra}
\usepackage{listings}

\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{makecell}
\usepackage{multicol}
\usepackage{multirow}

\usepackage{enumitem}

% compact itemized and then enumerated
\setlist{leftmargin=*,
  noitemsep,
  topsep=5pt,
  parsep=0pt,
  partopsep=0pt,
}

\setlist[enumerate]{leftmargin=*,
  itemsep=2pt,
  topsep=0pt,
  parsep=0pt,
  partopsep=0pt,
}

\usepackage{tabularx}
\usepackage{textcomp}
\usepackage{tikz}
\usetikzlibrary{arrows,automata,decorations.pathmorphing,backgrounds,positioning,fit}
\usepackage{pgf-umlcd}

\usepackage{fontspec}
\IfFontExistsTF{Gentium Book Basic}{
  \setmainfont{Gentium Book Basic}
}{
  \setmainfont{Times New Roman}
}
\IfFontExistsTF{Comic Code}{
  \setmonofont{Comic Code}[
    Scale = 0.85,
  ]
}{
}

\lstset{
  basicstyle=\ttfamily,
}

\newcommand{\checkpoint}{{\Large $\checkmark$} }

% classname
\newcommand\assignmentTitle{pWhatToWear -- Conditional Execution}
\newcommand\semester{Spring 2024}
\newcommand\className{Assembly Language and Computer Organization}
\newcommand\classNumber{CIS~356}
\newcommand\classFullName{\classNumber~\className}
\renewcommand{\dateseparator}{-}
\yyyymmdddate

% /classname

\pagestyle{headandfoot}
\firstpageheader{\classNumber\\\semester}{\assignmentTitle\\~}{\today\\~}
\runningheader{\assignmentTitle}{}{\today}

\newenvironment{showExample}[1]{
  \begingroup
  \renewcommand{\solutiontitle}{\noindent\textbf{Example:}\enspace}
  \printanswers
  \begin{solution}[#1]
}{
  \end{solution}
  \endgroup
}

\definecolor{outputgray}{gray}{0.95}


\begin{document}
\pointsinrightmargin{}

\section*{Learning Outcomes}
Upon completing this assignment, students should be able to

\begin{itemize}
\item \textbf{Program} a \emph{recursive} function to calculate the
  values in a Fibonacci sequence.
\item \textbf{Loop} to print out the first 15 elements.
\end{itemize}

\section*{Overview}
Write a program that uses a loop to generate the first 15 elements in
a Fibonacci sequence. Terms in the sequence will be generated by
calling a \emph{recursive} function, \lstinline{fibonacci} with the
index in the sequence.

\subsection*{Initial Values}
Traditionally, \textbf{the} Fibonacci sequence is the recurrence:

\noindent
$f_{n} = f_{n-1} + f_{n-2}$\\
$f_{1} = 1$\\
$f_{0} = 0$

\noindent
With first several terms then being: 0, 1, 1, 2 ,3, 5, 8, 13, 21, 35,
56, 91, 147, 238.

Changing the initial values without changing the recurrence produces a
different Fibonacci sequence. Each student will use their initials,
translated according to A=1, B=2, \emph{etc.}, as the initial
values. Thus Dr. Ladd (\textbf{B}rian \textbf{L}add) would use
$f_{0} = 2$ and $f_{1} = 12$.

\section*{Procedure}
Write a function of one integer parameter, \lstinline{fibonacci} that
returns the $n^{th}$ Fibonacci number in your, personal,
sequence.

Write a \lstinline{main} program that runs a \emph{count-controlled} loop from
0 to 14 (inclusive), printing the vaule of \lstinline{i} and
\lstinline{fibonacci(i)}, one such pair per line.

Program in \emph{commented} MIPS assembly language that loads and runs
in MARS. Make sure to include an appropriate ID block in the code.

\lstinline{README} documents what the code should do and how to rerun
any test cases you used.

Submit into Gitea \url{https://cs-devel.potsdam.edu} with the MIPS and
\lstinline{README} files.


\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
