Creating a personalized hobby-related message program

Report a typo

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.

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