cws/cw02.tex
changeset 268 e43f7e92ba26
parent 264 ecd989eee8bd
child 276 52faee6d0be2
equal deleted inserted replaced
267:9e0216756771 268:e43f7e92ba26
       
     1 % !TEX program = xelatex
     1 \documentclass{article}
     2 \documentclass{article}
     2 \usepackage{../style}
     3 \usepackage{../style}
     3 \usepackage{disclaimer}
     4 \usepackage{disclaimer}
     4 \usepackage{../langs}
     5 \usepackage{../langs}
     5 
     6 
    11 \mbox{}\hfill\textit{``What one programmer can do in one month,}\\
    12 \mbox{}\hfill\textit{``What one programmer can do in one month,}\\
    12 \mbox{}\hfill\textit{two programmers can do in two months.''}\smallskip\\
    13 \mbox{}\hfill\textit{two programmers can do in two months.''}\smallskip\\
    13 \mbox{}\hfill\textit{ --- Frederick P.~Brooks (author of The Mythical Man-Month)}\bigskip
    14 \mbox{}\hfill\textit{ --- Frederick P.~Brooks (author of The Mythical Man-Month)}\bigskip
    14 
    15 
    15 \noindent
    16 \noindent
    16 This coursework is worth 10\%. The first and second part are due
    17 This coursework is worth 10\%. The basic part is due
    17 on 22 November at 11pm; the third, more advanced part, is due on 20
    18 on 22 November at 11pm; the main part is due on 20
    18 December at 11pm. You are asked to implement Scala programs for
    19 December at 11pm. You are asked to implement Scala programs for
    19 measuring similarity in texts, and for recommending movies
    20 measuring similarity in texts, and for recommending movies
    20 according to a ratings list.  Note the second part might include
    21 according to a ratings list.  Note the second part might include
    21 material you have not yet seen in the first two lectures. \bigskip
    22 material you have not yet seen in the first two lectures. \bigskip
    22 
    23 
    32 \subsection*{Reference Implementation}
    33 \subsection*{Reference Implementation}
    33 
    34 
    34 Like the C++ assignments, the Scala assignments will work like this: you
    35 Like the C++ assignments, the Scala assignments will work like this: you
    35 push your files to GitHub and receive (after sometimes a long delay) some
    36 push your files to GitHub and receive (after sometimes a long delay) some
    36 automated feedback. In the end we take a snapshot of the submitted files and
    37 automated feedback. In the end we take a snapshot of the submitted files and
    37 apply an automated marking script to them.
    38 apply an automated marking script to them.\medskip
    38 
    39 
       
    40 \noindent
    39 In addition, the Scala assignments come with a reference
    41 In addition, the Scala assignments come with a reference
    40 implementation in form of a \texttt{jar}-file. This allows you to run
    42 implementation in form of a \texttt{jar}-file. This allows you to run
    41 any test cases on your own computer. For example you can call Scala on
    43 any test cases on your own computer. For example you can call Scala on
    42 the command line with the option \texttt{-cp docdiff.jar} and then
    44 the command line with the option \texttt{-cp docdiff.jar} and then
    43 query any function from the template file. Say you want to find out
    45 query any function from the template file. Say you want to find out
    80 \texttt{.take(n)} for taking some elements in a list (takes fewer if the list
    82 \texttt{.take(n)} for taking some elements in a list (takes fewer if the list
    81 contains less than \texttt{n} elements).
    83 contains less than \texttt{n} elements).
    82 
    84 
    83 
    85 
    84 \newpage
    86 \newpage
    85 \subsection*{Part 1 (4 Marks, file docdiff.scala)}
    87 \subsection*{Basic Part (4 Marks, file docdiff.scala)}
    86 
    88 
    87 It seems source code plagiarism---stealing and submitting someone
    89 It seems source code plagiarism---stealing and submitting someone
    88 else's code---is a serious problem at other
    90 else's code---is a serious problem at other
    89 universities.\footnote{Surely, King's students, after all their
    91 universities.\footnote{Surely, King's students, after all their
    90   instructions and warnings, would never commit such an offence. Yes?}
    92   instructions and warnings, would never commit such an offence. Yes?}
   165   and then calculating the overlap of the resulting documents.\\
   167   and then calculating the overlap of the resulting documents.\\
   166   \mbox{}\hfill\mbox{[1 Mark]}
   168   \mbox{}\hfill\mbox{[1 Mark]}
   167 \end{itemize}\bigskip
   169 \end{itemize}\bigskip
   168 
   170 
   169 
   171 
   170 \subsection*{Part 2 (2 Marks, file danube.scala)}
   172 \subsection*{Main Part (2 Marks, file danube.scala)}
   171 
   173 
   172 You are creating Danube.co.uk which you hope will be the next big thing
   174 You are creating Danube.co.uk which you hope will be the next big thing
   173 in online movie renting. You know that you can save money by
   175 in online movie renting. You know that you can save money by
   174 anticipating what movies people will rent; you will pass these savings
   176 anticipating what movies people will rent; you will pass these savings
   175 on to your users by offering a discount if they rent movies that
   177 on to your users by offering a discount if they rent movies that
   227 \item[(2)] Implement two functions that process the (broken up)
   229 \item[(2)] Implement two functions that process the (broken up)
   228   CSV-files from (1). The \pcode{process_ratings} function filters out all
   230   CSV-files from (1). The \pcode{process_ratings} function filters out all
   229   ratings below 4 and returns a list of (userID, movieID) pairs. The
   231   ratings below 4 and returns a list of (userID, movieID) pairs. The
   230   \pcode{process_movies} function returns a list of (movieID, title) pairs.\\
   232   \pcode{process_movies} function returns a list of (movieID, title) pairs.\\
   231   \mbox{}\hfill [1 Mark]
   233   \mbox{}\hfill [1 Mark]
   232 \end{itemize}  
   234 %\end{itemize}  
   233   
   235 %  
   234 
   236 %
   235 \subsection*{Part 3 (4 Marks, file danube.scala)}
   237 %\subsection*{Part 3 (4 Marks, file danube.scala)}
   236 
   238 %
   237 \subsection*{Tasks}
   239 %\subsection*{Tasks}
   238 
   240 %
   239 \begin{itemize}
   241 %\begin{itemize}
   240 \item[(3)] Implement a kind of grouping function that calculates a Map
   242 \item[(3)] Implement a kind of grouping function that calculates a Map
   241   containing the userIDs and all the corresponding recommendations for
   243   containing the userIDs and all the corresponding recommendations for
   242   this user (list of movieIDs). This should be implemented in a
   244   this user (list of movieIDs). This should be implemented in a
   243   tail-recursive fashion using a Map as accumulator. This Map is set to
   245   tail-recursive fashion using a Map as accumulator. This Map is set to
   244   \pcode{Map()} at the beginning of the calculation. For example
   246   \pcode{Map()} at the beginning of the calculation. For example
   283   the actual movie name, not the movieID. If fewer movies are recommended,
   285   the actual movie name, not the movieID. If fewer movies are recommended,
   284   then return fewer than two movie names.\\
   286   then return fewer than two movie names.\\
   285   \mbox{}\hfill [1 Mark]
   287   \mbox{}\hfill [1 Mark]
   286 \end{itemize}
   288 \end{itemize}
   287 
   289 
   288 \end{document}
   290 \end{document} 
   289 
   291 
   290 %%% Local Variables: 
   292 %%% Local Variables: 
   291 %%% mode: latex
   293 %%% mode: latex
   292 %%% TeX-master: t
   294 %%% TeX-master: t
   293 %%% End: 
   295 %%% End: