0

Everything what is needed, i did! But still 1 test case is getting failed! What's wrong?

fun shippingCost(amount: Double, international: Boolean): Double { var result = 0.0 if(amount > 75 && international == false){ result = 0.0 } else if (amount < 75 && international==false){ result += amount * .1 } else if(international==true && amount > 75){ result = amount * .15 } return result } fun main(args: Array<String>) { val total = readLine()!!.toDouble() val international = readLine()!!.toBoolean() println(shippingCost(total, international)) }

22nd Jan 2022, 6:21 PM
Annesh Lobdha Singh
Annesh Lobdha Singh - avatar
4 Antworten
+ 2
Read the description : "... For international orders, there is a 15% shipping fee, with a maximum of $50..." There is something missing in your code.
22nd Jan 2022, 8:01 PM
Coding Cat
Coding Cat - avatar
+ 1
No, not 50%. For International Transport: Shipping fee is 15% for ALL Orders, but the shipping fee should NEVER be greater than 50.00 Dollar.
23rd Jan 2022, 8:42 AM
Coding Cat
Coding Cat - avatar
0
Set a condition for international as true and amount<75
22nd Jan 2022, 7:35 PM
Adi Nath Bhawani
Adi Nath Bhawani - avatar
0
But it is not given that when will it be 50% Coding Cat
23rd Jan 2022, 2:41 AM
Annesh Lobdha Singh
Annesh Lobdha Singh - avatar