I can not pass one test out of five. Kotlin exam. shipping cost calculator
The store uses the following pricing structure: For US orders: - orders over $75 have free shipping - For orders less than $75, shipping costs are 10% of the total order value. For international orders, shipping charges are 15%, with a maximum of $50. This means that the maximum shipping cost for international orders is $50. You need to extend this shippingCost() fun, which takes the cost of the order and a boolean indicating whether the order is international and returns the shipping cost for that order. The return value must be Double. Code 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)) }