In the problem, the number of cookies depend upon the number of hours, as increase in number of hours increase number of cookies and decrease in number of hours decrease the number of cookies.
So cookies is dependent variable and number of hours is independent variable.
Thus, dependent variable is number of cookies.