Below is a small program in Scala 3. It transforms numbers of different types into a final string and prints the result.
scala-cli/scala-compatible mode without additional libraries.Main.scala.environment section.The program should print exactly one line to stdout, with no extra trailing spaces and no additional newlines except the terminating one.
object Main:
def normalize(a: Int, b: Long, c: Double): String =
val left = a.toLong + b
val middle = c.toInt + a
val right = (b.toDouble / 4.0).toInt
s"${left}:${middle}:${right}"
@main def run(): Unit =
val result = normalize(7, 13L, 9.8)
println(result)
Click a line and write what it prints. Explanation is optional.