Why 3 test in Kotlin 25 gave me a error? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Why 3 test in Kotlin 25 gave me a error?

fun shippingCost(amount: Double, international: Boolean): Double { if(international == false && amount >= 75){ return (amount % amount) } if(international == false && amount < 75){ return (amount * 10 / 100) } else{ return (amount * 15 / 100) } } fun main(args: Array<String>) { val total = readLine()!!.toDouble() val international = readLine()!!.toBoolean() println(shippingCost(total, international)) }

22nd Jan 2022, 12:13 PM
SecDet
SecDet - avatar
1 Resposta
+ 1
For international orders, there is a 15% shipping fee, with a maximum of $50. This means that the maximum shipping fee for an international order is $50. So, you should return 50.0 if amount *0.15 is greater than 50$.
22nd Jan 2022, 2:08 PM
Simba
Simba - avatar