0

What's the error

It seems like there's an input, it's not able to give the amount for.

14th Mar 2023, 10:00 PM
Uyi Oduware
Uyi Oduware - avatar
4 Respostas
0
Provide your code. Specify programming language. State the error
14th Mar 2023, 10:20 PM
Lamron
Lamron - avatar
0
fun shippingCost(amount: Double, internal: Boolean): Double { var cost =0.0 var maximum: Double = amount*0.15 if (amount < 75.0 && internal== false){ var cost: Double = amount*0.10 return cost } else if (amount >= 75.0 && internal == false) { var cost: Double = 0.0 return cost } else if (internal== true && maximum < 50.0) { var cost: Double = amount*0.15 return cost } else { if (internal == true && maximum >=50.0){ var cost: Double = 50.0 } return cost } } fun main(args: Array<String>) { val total = readLine()!!.toDouble() val international = readLine()!!.toBoolean() println(shippingCost(total, international)) }
14th Mar 2023, 10:27 PM
Uyi Oduware
Uyi Oduware - avatar
14th Mar 2023, 10:28 PM
Uyi Oduware
Uyi Oduware - avatar
0
You need 2 inputs. Since you only get one box for the input you need to hit return before each new input then hit submit
15th Mar 2023, 12:49 AM
Bob