coursework/cw04.tex
changeset 320 0c43ef11e086
parent 313 90ccc385c547
child 321 c5850f8f3f5e
equal deleted inserted replaced
319:e7b110f93697 320:0c43ef11e086
    72 Java Byte Code instructions for the Jasmin assmebler. As
    72 Java Byte Code instructions for the Jasmin assmebler. As
    73 solution you need to submit the assembler instructions for the
    73 solution you need to submit the assembler instructions for the
    74 Fibonacci and Factorial programs. Both should be so modified
    74 Fibonacci and Factorial programs. Both should be so modified
    75 that a user can input on the console which Fibonacci number 
    75 that a user can input on the console which Fibonacci number 
    76 and which Factorial should calculated. The Fibonacci program
    76 and which Factorial should calculated. The Fibonacci program
    77 is  given in Figure~\ref{fibs}.
    77 is  given in Figure~\ref{fibs}. You can write your own program
       
    78 for calculating factorials.
    78 
    79 
    79 \begin{figure}[t]
    80 \begin{figure}[t]
    80 \lstinputlisting[language=while]{../progs/fib.while}
    81 \lstinputlisting[language=while]{../progs/fib.while}
    81 \caption{The Fibonacci program in the WHILE language.}
    82 \caption{The Fibonacci program in the WHILE language.\label{fibs}}
    82 \end{figure}
    83 \end{figure}
    83 
    84 
    84 \subsection*{Question 2 (marked with 5\%)}
    85 \subsection*{Question 2 (marked with 5\%)}
    85 
    86 
    86 Extend the syntax of you language so that it contains also \texttt{for}-loops, like
    87 Extend the syntax of you language so that it contains also \texttt{for}-loops, like