// // simple demo of using collection methods to operate on lists // // use recursive method to fill list so we can enter as many // values as we like // could also use List.fill(size)(readInt) println("type in list values (integers), quit to end") val list = fillList() println("you entered:") list.foreach(println(_)) println("sum = " + list.sum) println("product = " + list.product) println("min = " + list.min) println("max = " + list.max) def fillList() : List[Int] = { val input = readLine if (input == "quit") Nil else input.toInt::fillList() }