And the error message *told* you the problem. You just need to learn how to read error messages.
"error: number cannot be resolved to a variable".
In other words, you don't have any variable that is named number
. Okay, so then I look at your code and it's obvious what variable should be there, instead.