0
I got the error Process killed , because it ran longer than 10 seconds when i ran the code below .Please Help me
fun shippingCost(amount: Double, international: Boolean): Double { var fee : Double = 0 if(international){ if(amount * 0.15 > 50){ fee = 50 }else fee = amount * 0.15 }else { if(amount >= 75 ){ fee = 0.0 }else fee = 0.1 * amount } return fee } fun main(args: Array<String>) { val total = readLine()!!.toDouble() val international = readLine()!!.toBoolean() println(shippingCost(total, international)) }
2 Antworten
+ 7
Your code has two errors: line 3 & 6.
3: var fee : Double = 0.0
6: fee = 50.0
Fixing those and it ran fine. Sometimes SoloLearn times out and gives a random error that vanishes on rerun.
0
Oh yeah ! Thank you very much.