Greetings

Report a typo

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.

Sample Input 1:

Scally

Sample 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(""))
}
___

Create a free account to access the full topic