Algebraically, the question looks like this:
2.5 = 0.35x + 0.25y
However, that's the only equation we get, so we can't solve for x and y this way. There would be an infinite number of possible values of x and y.
Instead, we must use an intelligent version of guessing and checking. Since at least one pencil and one pen is purchased, the customer must spend at least $2.25 ($2.50 minus $0.25) on pens. There are six possible numbers of pens that fit that requirement:
1 pen: $0.35
2 pens: $0.70
3 pens: $1.05
4 pens: $1.40
5 pens: $1.75
6 pens: $2.10
Many of those aren't applicable here, though. For instance, if the customer bought 6 pens, he would need to spend an additional $0.40 on pencils. At $0.25 per pencil, that's impossible. Consider each of the other 5:
1 pen: $2.15 on pencils
2 pens: $1.80 on pencils
3 pens: $1.45 on pencils
4 pens: $1.10 on pencils
5 pens: $0.75 on pencils
Only the last of these works. $0.75 is 3 pencils for $0.25 each. That's 5 pens and 3 pencils for a total of 8 pens and pencils. Choice (A) is correct.