You need to put
var input = readLine("Enter a List")
val cmd = readLine("Entera command")
input=input.replace(" ","")
var input2=input.split(",").toList
part into exercise()
function and call it recursively.
This is for asking until You type exit
The second problem is getAverageLeng
signature it should return Double
not Number
,
and change sum.asInstanceOf[Int]
to sum.asInstanceOf[Double]
in this function.