0
Kotlins ...parking fee
fun main(args: Array<String>) { var hours = readLine()!!.toDouble() //var total: Double = 0.0 if (hours <= 5){ println(hours) } else if (hours >5 && hours<= 24){ println(5+(hours-5)*0.5) } else println(15+ (hours-24)*0.5 ) } I tried this code and it’s not working ,..I don’t know what I am missing..pls help me out
2 odpowiedzi
0
Simba u should just leave what u see
0
You have "//" at the beginning, removing the double (you need all the answers as a double - so make sure all your multipliers are with a ".").
Also, why not use a "when" instead of "if, else if"?