mapFunction
takes the integer input from command line. A list must be generated with the input
number of elements in the list starting from zero. Each number in the List generated numberList
must be incremented by 5 using the map
and incrementer
function, and the resultant list must be printed.
object mapFunction{
def main(args :Array[String]){
val input = args(0).toInt
val numberList = //complete the code
def incrementer //complete the code
val incrementList = //complete the code
println(incrementList)
}
}
output will be : List(5,6,7)
I did it :
object mapFunction{
def main(args :Array[String]){
val input = args(0).toInt
val numberList = List.range(0, input+1)
def incrementer //complete the code
val incrementList = //complete the code
println(incrementList)
}
}
then how to proceed, I am a new learner. please help