Hey, cool news! Ryan Gosling became your regular customer, and he appreciates working with such a developer like you. Ryan came to you with a new task: he plays in a cool band Dead Man’s Bones, and he wants to be able to change the settings of his microphone from song to song. He wrote a template with a data class Microphone. New settings will come from standard input, and your job is to write a scope function that will implement them.
Scope functions: summary
Dead Man’s Bones
Report a typo
Sample Input 1:
Pa Pa Power
1000
Microphone box
2.7Sample Output 1:
Microphone(track=Pa Pa Power, frequency=1000, effect=Microphone box, sensitivity=2.7)Write a program in Kotlin
data class Microphone(
var track: String = "",
var frequency: Int = 0,
var effect: String = "",
var sensitivity: Double = 0.0
)
fun main() {
val microphone = Microphone()
// Write scope function that receive new settings from standard input and set up them to the Microphone
microphone.
println(microphone)
}
___
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.