I have a very simple question that I cannot find the answer to. I am trying to plug an array of x and y values through an equation, and fill an array with the answers. The error in this code is that the arrays don't accept numbers because "error: 'Range' is not convertible to 'Int'". How would I deal with this? This is done with Xcode 6.01 in swift playground. Thanks!
let x = [5.0,2.0,43.0,1.0,5.0]
let y = [62.0,2.0,43.0,1.0,4.0]
var answers=[Double]()
var current:Double = 0
for numbers in [0...4] {
current = 1800*x[numbers] + 1600*y[numbers]
answers.append(current)
}
println(answers)