fun calcInterest(amount: Double, interest: Double): Double {
return(amount *(interest/100.0))
}
fun main(args: Array) {
for (i in 1.0..2.
According to the documentation for ranges:
Floating point numbers (
Double,Float) do not define theirrangeTooperator, and the one provided by the standard library for generic Comparable types is used instead:
public operator fun > T.rangeTo(that: T): ClosedRange
The range returned by this function cannot be used for iteration.
You will have to use some other kind of loop since you can't use ranges.