KT
kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fun shippingCost(a: Double, i: Boolean): Double {
var b:Double= when {
a<75 ->if(i==true) a/100*15 else a/10
a>=75 ->if(i==true) a/100*15 else 0.0
else-> 0.0
}
if(b>50.0){
b=50.0
}
return b
}
fun main(args: Array<String>) {
val total = readLine()!!.toDouble()
val international = readLine()!!.toBoolean()
println(shippingCost(total, international))
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run