John is a software developer who loves coding. He wants to create a program that outputs a personalized message about his hobby and how many hours he spends on it each week. The message should be in the format of 'I love [hobby] and I spend about [hours] hours on it each week.' where [hobby] and [hours] are variables. The challenge here is to reorder the lines of Kotlin code to create a program that does just that.
String templates
Creating a personalized hobby-related message program
Report a typo
Reorder lines using drag or arrows. Adjust indentation with left buttons
val stringTemplate = "I love $hobby and I spend about $hoursPerWeek hours on it each week."
val hobby = "coding"
println(stringTemplate)
}
val hoursPerWeek = 15
fun main() {
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.