# HG changeset patch # User Christian Urban # Date 1478741472 0 # Node ID d0caa12ab8d8dbfb655a851cfb4564e8aee6e133 # Parent bb8c3dd8c75cd654747ff07818b604fd83534782 updated diff -r bb8c3dd8c75c -r d0caa12ab8d8 cws/cw01.pdf Binary file cws/cw01.pdf has changed diff -r bb8c3dd8c75c -r d0caa12ab8d8 cws/cw01.tex --- a/cws/cw01.tex Thu Nov 10 01:30:45 2016 +0000 +++ b/cws/cw01.tex Thu Nov 10 01:31:12 2016 +0000 @@ -5,7 +5,7 @@ \begin{document} \section*{Coursework 6 (Scala)} - + This coursework is about Scala and is worth 10\%. The first and second part are due on 16 November at 11pm, and the third part on 23 November at 11pm. You are asked to implement three programs about list @@ -83,7 +83,7 @@ \item[(2)] Write a second function that takes an upper bound as argument and calculates the steps for all numbers in the range from 1 up to this bound. It returns the maximum number of steps and the - corresponding number that needs that many steps. More precisely, + corresponding number that needs that many steps. More precisely it returns a pair where the first component is the number of steps and the second is the corresponding number. \hfill\mbox{[1 Mark]} @@ -125,7 +125,7 @@ to buy and when to sell this commodity. In the example above it should return the pair $\texttt{(1, 3)}$ because at index $1$ the price is lowest and then at index $3$ the price is highest. Note the prices are given as -lists of \texttt{Double}s.\newline \mbox{} \hfill[1 Mark] +lists of \texttt{Float}s.\newline \mbox{} \hfill[1 Mark] \item[(2)] Write a function that requests a comma-separated value (CSV) list from the Yahoo websevice that provides historical data for stock @@ -186,13 +186,13 @@ \subsection*{Advanced Part 3 (3 Marks)} -A purely fictional character named Mr T.~Drumb inherited in 1978 -approximately 200 Million Dollar from his father. Mr Drumb prides +A purely fictional character named Mr T.~Drump inherited in 1978 +approximately 200 Million Dollar from his father. Mr Drump prides himself to be a brilliant business man because nowadays it is estimated he is 3 Billion Dollar worth (one is not sure, of course, -because Mr Drumb refuses to make his tax records public). +because Mr Drump refuses to make his tax records public). -Since the question about Mr Drumb's business acumen remains open, let's do a +Since the question about Mr Drump's business acumen remains, let's do a quick back-of-the-envelope calculation in Scala whether his claim has any merit. Let's suppose we are given \$100 in 1978 and we follow a really dump investment strategy, namely: @@ -215,7 +215,7 @@ \end{itemize}\medskip \noindent -\textbf{Tasks (file drumb.scala):} +\textbf{Tasks (file drump.scala):} \begin{itemize} \item[(1.a)] Write a function that queries the Yahoo financial data @@ -313,7 +313,7 @@ turn out to be a blue chip company. Also, since the portfolios are chosen from the current S\&P 500, they do not include the myriad of companies that went bust or were de-listed over the years. -So where does this leave our fictional character Mr T.~Drumb? Well, given +So where does this leave our fictional character Mr T.~Drump? Well, given his inheritance, a really dumb investment strategy would have done equally well, if not much better. \end{document}