I'm fairly new to Swift and this has got me stumped. I have :
for values in input {
if num >= 80 {
message = "hot!"
}
else if num >= 60 && num < 80 {
message = "warm!"
}
else if num >= 40 && num < 60 {
message = "cool!"
}
else if num <= 40 {
message = "cold!"
}
print("The temperature \(values) is \(message)")
}
And this is printing as
"Please enter a temperature 65"
"Please enter a temperature 1"
"Please enter a temperature 100"
"Please enter a temperature 56"
"Please enter a temperature 46"
"The temperature 65 is warm!"
"The temperature 1 is warm!"
"The temperature 100 is warm!"
"The temperature 56 is warm!"
"The temperature 46 is warm!"
As you can see it's not going one by one but instead naming each element of array the same. What am I doing wrong here? I'm using readLine() for the array elements.