Good afternoon, I'm new to Kotlin and working through a Big Nerd Ranch book, I came across the function in their code and it isn't working, can someone help me with the solution.
val healthStatus = when (healthpoints) {
in 100..89 -> EXCELLENT_HEALTH
in 90..99 -> GOOD_HEALTH
in 75..98 -> MINOR_HEALTH
in 75..89 -> if (isBlessed) {IS_BLESSED
} else {
}
in 15..74 -> LOW_HEALTH
else -> POOR_HEALTH
}
...
println("$name $healthStatus")
isBlessed is set to true, and I have a string stored in const val IS_BLESSED. The issue I am having is that string is not printing regardless the range of the healthpoints.