diff -r 017f621f5835 -r 3ffe978a5664 cws/main_cw01.tex --- a/cws/main_cw01.tex Thu Nov 04 12:20:12 2021 +0000 +++ b/cws/main_cw01.tex Fri Nov 05 16:47:55 2021 +0000 @@ -33,19 +33,19 @@ function from the template file. Say you want to find out what the function \code{get_january_data} produces: for this you just need to prefix them with the object name -\texttt{CW6b} and call them with some arguments: +\texttt{M1} and call them with some arguments: \begin{lstlisting}[language={},numbers=none,basicstyle=\ttfamily\small] $ scala -cp drumb.jar -scala> CW6b.get_january_data("FB", 2014) +scala> M1.get_january_data("FB", 2014) val res2: List[String] = List(2014-01-02,54.709999,....) \end{lstlisting}%$ \subsection*{Hints} \noindent -\textbf{For the Main Part:} useful string functions: +\textbf{For Main Part 1:} useful string functions: \texttt{.startsWith(...)} for checking whether a string has a given prefix, \texttt{\_ ++ \_} for concatenating two strings; useful option functions: \texttt{.flatten} flattens a list of options such that it @@ -58,13 +58,13 @@ \texttt{.split(",").toList} for splitting strings according to a comma.\bigskip -\noindent +\noindent\alert \textbf{Note!} Fortunately Scala supports operator overloading. But make sure you understand the difference between \texttt{100 / 3} and \texttt{100.0 / 3}! \newpage -\subsection*{Main Part (7 Marks, file drumb.scala)} +\subsection*{Main Part 1 (7 Marks, file drumb.scala)} A purely fictional character named Mr T.~Drumb inherited in 1978 approximately 200 Million Dollar from his father. Mr Drumb prides @@ -102,7 +102,13 @@ severely rate-limited. Therefore this part comes with a number of files containing CSV-lists with the historical stock prices for the companies in our portfolios. Use these files for the following -tasks.\bigskip +tasks.\medskip + +\noindent\alert +\textbf{Note:} Do not hardcode the path to the CSV-files. The testing +framework will assume that these files are in the same directory as the +drumb.scala file. +\bigskip \newpage \noindent @@ -231,7 +237,9 @@ 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 his inheritance, a really dumb investment strategy would have done -equally well, if not much better.\medskip +equally well, if not much better. And one would assume this guy is +by now locked up in prison and the key thrown away, but alas he +is still around annoying commonsense people.\medskip \end{document}