Cooper and his children went into a grocery store and he bought $6 worth of apples and bananas. Each apple costs $1 and each banana costs $0.50. He bought a total of 10 apples and bananas altogether. Determine the number of apples, x, and the number of bananas, y, that Cooper bought.