Modify the program below to output greetings for the user with the name received by input. Note that the mkString method concatenates all list elements to a string with the separator as an argument.
Introduction to collections
Greetings
Report a typo
Sample Input 1:
ScallySample Output 1:
Hello, Scally!Write a program in Scala 3
object Greetings extends App {
val name = scala.io.StdIn.readLine()
val list = "Hello, " :: ??? :: "!" :: ???
println(list.mkString(""))
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.