Counting number of ways to buy items 
A man buys 240 items for \$250 at a store. There are 3 types of items: A (\$15), B (\$1) and C (25¢). He buys at least one of each. How many solutions?

I am working on this problem for a programming logic class. I have already completed a program, but I want to find a way to check if it is correct or not. I got four solutions:
A = 2 bought, B = 214 bought, C = 24 bought: Solution #1
A = 5 bought, B = 155 bought, C = 80 bought: Solution #2
A = 8 bought, B = 96 bought, C = 136 bought: Solution #3
A = 11 bought, B = 37 bought, C = 192 bought: Solution #4

I am solving it using two for loops (in Javascript). First loop = number of object A (from 1 to 13), second loop = number of object B (from 1 to 234). Then, I fill the rest in with object C, and I print whatever equals 250$. I believe I have the right answer, but I would like to figure out an equation to check it. The number of solutions is between 1 and 50.

As it is indicated in comments , you can use generating functions as alternative ways. To do this , lets use the exponents of $x's$ as cost of product , and use the exponent of $a's$ as the number of items.
As @trueblueanil mentioned , we can say that $60A +4B+C=1000$ by multiply both side of $15A+B+(1/4)C=250$ by $4$
Then ,

*

*Generating function for type A : $$a^1x^{60}+a^2x^{120}+a^3x^{180}+...+a^kx^{60k}+...= \frac{ax^{60}}{1-ax^{60}}$$


*Generating function for type B : $$a^1x^{4}+a^2x^{8}+a^3x^{12}+...+a^kx^{4k}+...= \frac{ax^4}{1-ax^4}$$


*Generating function for type C : $$a^1x^{1}+a^2x^{2}+a^3x^{3}+...+a^kx^{k}+...= \frac{ax}{1-ax}$$
Now , find the coefficient of $a^{240}x^{1000}$ in the expansion of $$\bigg(\frac{ax^{60}}{1-ax^{60}}\bigg)\bigg(\frac{ax^4}{1-ax^4}\bigg)\bigg(\frac{ax}{1-ax}\bigg)$$
I think you can find it using your programming skills.
