// // program to sum up numbers, entered from standard input // ending with "quit" // the next line is needed to avoid warnings with the newest Scala // "comment it out" (insert a //) if you compile with an earlier version import scala.io.StdIn._ def sum() : Int = { println("enter more numbers to add up, quit to stop") val n = readLine if (n == "quit") 0 else n.toInt + sum() } println("sum is " + sum)