your loop misses braces (for (...){code here}
). It only sees the immediate next line (weeklySales...
) as belonging to it, but not the second. So i
is not in scope there.
Then you’re using an array, not a list, you access it using data[i]
rather than data.get(i)
CLICK HERE to find out more related problems solutions.