You have an instance of the class Musician. Using a proper scope function, write code that will output information about different musicians.
Scope functions: let, run, and with
Organize your code again
Report a typo
Sample Input 1:
Liam Gallagher
Oasis
VocalSample Output 1:
Name: Liam Gallagher
Band: Oasis
Role: VocalWrite a program in Kotlin
data class Musician(var name: String = "", var band: String = "", var role: String = "")
fun main() {
val musician = Musician()
musician.apply {
name = readln()
band = readln()
role = readln()
}
// Write your code here
}
___
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.