cws/cw01.tex
changeset 210 63a1376cbebd
parent 202 f7bcb27d1940
child 251 3dd550b9b0e3
equal deleted inserted replaced
209:40bdf9064e13 210:63a1376cbebd
   138   assume this function will be called with numbers between $1$ and
   138   assume this function will be called with numbers between $1$ and
   139   $1$ Million. \hfill[2 Marks]
   139   $1$ Million. \hfill[2 Marks]
   140 
   140 
   141 \item[(2)] Write a second function that takes an upper bound as
   141 \item[(2)] Write a second function that takes an upper bound as
   142   argument and calculates the steps for all numbers in the range from
   142   argument and calculates the steps for all numbers in the range from
   143   1 up to this bound. It returns the maximum number of steps and the
   143   1 up to this bound (the bound including). It returns the maximum number of
   144   corresponding number that needs that many steps.  More precisely
   144   steps and the corresponding number that needs that many steps.  More
   145   it returns a pair where the first
   145   precisely it returns a pair where the first component is the number
   146   component is the number of steps and the second is the
   146   of steps and the second is the corresponding number. \hfill\mbox{[1
   147   corresponding number. \hfill\mbox{[1 Mark]}
   147     Mark]}
   148 \end{itemize}
   148 \end{itemize}
   149 
   149 
   150 \noindent
   150 \noindent
   151 \textbf{Test Data:} Some test ranges are:
   151 \textbf{Test Data:} Some test ranges are:
   152 
   152