Scala programming exercises