cws/cw01.tex
changeset 343 c8fcc0e0a57f
parent 336 25d9c3b2bc99
equal deleted inserted replaced
342:aa47abb9e723 343:c8fcc0e0a57f
     6 
     6 
     7 
     7 
     8 
     8 
     9 \begin{document}
     9 \begin{document}
    10 
    10 
    11 \section*{Preliminary Part 6 (Scala)}
    11 \section*{Preliminary Part 6 (Scala, 3 Marks)}
    12 
    12 
    13 \mbox{}\hfill\textit{``The most effective debugging tool is still careful thought,}\\
    13 \mbox{}\hfill\textit{``The most effective debugging tool is still careful thought,}\\
    14 \mbox{}\hfill\textit{coupled with judiciously placed print statements.''}\smallskip\\
    14 \mbox{}\hfill\textit{coupled with judiciously placed print statements.''}\smallskip\\
    15 \mbox{}\hfill\textit{ --- Brian W. Kernighan, in Unix for Beginners (1979)}\bigskip
    15 \mbox{}\hfill\textit{ --- Brian W. Kernighan, in Unix for Beginners (1979)}\bigskip
    16 
    16 
   239   Worldbank database, see \url{https://github.com/datasets/population/tree/master/data} for the original.} Again, split the
   239   Worldbank database, see \url{https://github.com/datasets/population/tree/master/data} for the original.} Again, split the
   240   strings according to the commas. However, this time generate a
   240   strings according to the commas. However, this time generate a
   241   \texttt{Map} from country names to population sizes.\hfill[1 Mark]
   241   \texttt{Map} from country names to population sizes.\hfill[1 Mark]
   242 
   242 
   243 \item[(3)] In (2) you generated the data about the alcohol consumption
   243 \item[(3)] In (2) you generated the data about the alcohol consumption
   244   per capita for each country, and also the population size for each
   244   per-capita for each country, and also the population size for each
   245   country. From this generate next a sorted(!) list of the overall
   245   country. From this generate next a sorted(!) list of the overall
   246   alcohol consumption for each country. The list should be sorted from
   246   alcohol consumption for each country. The list should be sorted from
   247   highest alcohol consumption to lowest. The difficulty is that the
   247   highest alcohol consumption to lowest. The difficulty is that the
   248   data is scraped off from ``random'' sources on the Internet and
   248   data is scraped off from ``random'' sources on the Internet and
   249   annoyingly the spelling of some country names does not always agree in both
   249   annoyingly the spelling of some country names does not always agree in both