Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun main () {
- val hours = readLine()!!.toInt()
- var total = 0.0
- when {
- hours <=5 -> {
- total += hours
- println(total)
- }
- hours in 6..23 -> {
- val y= (hours-5)*0.5
- total =(y+5)
- println(total)
- }
- hours >= 24 && hours % 24 !=0 && hours <48-> {
- val z = (hours-24)*0.5
- total=(z+15)
- println( total)
- }
- hours>=48 && hours % 24 ==0 -> {
- val v= hours /24
- total = (v*15).toDouble()
- println(total)
- }
- hours >48 && hours % 24 !=0 ->{
- val k = hours /24
- val m = k*24
- val d = hours - m
- val j = d*0.5
- val l = k*15
- total= l+j
- println(total)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement