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