You have a piece of code, and you asked a colleague to review it. This code works correctly, but your colleague wants you to better organize it. "I don't like that we define day, month, and year above data. We don't use them in the code below, and I want to ask you to make your code more readable." Using a scope function, make it so that day, month, and year are defined and passed to data at the time of data initialization.
Scope functions: let, run, and with
Organize your code
Report a typo
Sample Input 1:
14
11
1983Sample Output 1:
11.14.1983Write a program in Kotlin
fun main() {
val day = readln()
val month = readln()
val year = readln()
val data = "$month.$day.$year"
// Do not change the code below
println(data)
}
___
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.