Binary file cws/cw01.pdf has changed
--- a/cws/cw01.tex Thu Nov 10 11:41:50 2016 +0000
+++ b/cws/cw01.tex Fri Nov 11 11:17:40 2016 +0000
@@ -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{Float}s.\newline \mbox{} \hfill[1 Mark]
+lists of \texttt{Double}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.~Drump inherited in 1978
-approximately 200 Million Dollar from his father. Mr Drump prides
+A purely fictional character named Mr T.~Drumb inherited in 1978
+approximately 200 Million Dollar from his father. Mr Drumb 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 Drump refuses to make his tax records public).
+because Mr Drumb refuses to make his tax records public).
-Since the question about Mr Drump's business acumen remains, let's do a
+Since the question about Mr Drumb'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:
@@ -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.~Drump? Well, given
+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.
\end{document}
--- a/progs/trade.scala Thu Nov 10 11:41:50 2016 +0000
+++ b/progs/trade.scala Fri Nov 11 11:17:40 2016 +0000
@@ -41,14 +41,14 @@
// some test cases
-//query_comp("GOOG")
+//query_company("GOOG")
// some more test cases
/*
val indices = List("GOOG", "AAPL", "MSFT", "IBM", "FB", "YHOO", "AMZN", "BIDU")
for (name <- indices) {
- val times = query_comp(name)
+ val times = query_company(name)
println(s"Buy ${name} on ${times._1} and sell on ${times._2}")
}
*/