--- a/main_solution1/drumb.scala Thu Nov 04 12:20:12 2021 +0000
+++ b/main_solution1/drumb.scala Fri Nov 05 16:47:55 2021 +0000
@@ -24,7 +24,7 @@
// strings for each line in the CSV-file.
def get_january_data(symbol: String, year: Int) : List[String] =
- Source.fromFile(symbol ++ ".csv")("ISO-8859-1").getLines.toList.filter(_.startsWith(year.toString))
+ Source.fromFile(symbol ++ ".csv")("ISO-8859-1").getLines().toList.filter(_.startsWith(year.toString))
//test cases
@@ -169,10 +169,32 @@
//test cases for the two portfolios given above
-//println("Real data: " + investment(rstate_portfolio, 1978 to 2019, 100))
-//println("Blue data: " + investment(blchip_portfolio, 1978 to 2019, 100))
+ println("Real data: " + investment(rstate_portfolio, 1978 to 2019, 100))
+ println("Blue data: " + investment(blchip_portfolio, 1978 to 2019, 100))
+
}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+import CW6b._
+investment(rstate_portfolio, 1978 to 2019, 100)