0
What's the problem in my code
Here is my code: fun main(args: Array<String>) { var hours = readLine()!!.toInt() var total: Double = 0.0 if (hours<=5){ println(hours) } else if (hours>5 && hours<24){ println(5+(hours-5)*.5) } else{ println(((hours-hours%24)/24)*15 + (hours%24)*.5) } } . Only one test failed number 4
2 Answers
0
M.A. Masud Karim Nayeem
Why hours - hours%24?
why not just (hours / 24) because we need exact hours
0
Cz that will be point value like 2.33 or something..we need full number