0

Help to resolve my Kotlin code please

fun shippingCost(amount: Double, international: Boolean): Double { var cost: Double if(international) { if ((amount * 0.15) >= 50.0) { cost = 50.0 } else { cost = amount * 0.15 } } else { if (amount > 75.0) { cost = 0.0 } else { cost = 75.0 * 0.1 } } return cost } fun main(args: Array<String>) { val total = readLine()!!.toDouble() val international = readLine()!!.toBoolean() println(shippingCost(total, international)) }

19th Mar 2022, 7:43 PM
Юра Соляр
Юра Соляр - avatar
2 Respuestas
0
*I can not pass one test out of five
19th Mar 2022, 7:48 PM
Юра Соляр
Юра Соляр - avatar