0
What's the error
It seems like there's an input, it's not able to give the amount for.
4 Respostas
0
Provide your code. Specify programming language. State the error
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))
}
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