Counting non-negative integer solutions to an equation

Problem: In how many ways can ten identical books be distributed to four students such that
(a) Each student gets at most five books.
(b) Each student gets at least one book and at most five books.
(c) No student gets exactly three books. Hint: A or B or C or D!

The problem corresponds to finding the number of nonnegative integer solutions
to the equation X1+X2+X3+X4 = 10 (where Xi is # of books given to the i-th student)
under the restrictions specified as parts(a), (b) or (c).
The Javascript solution utilizes this fact (view the HTML (Frame) source).
Note: The JavaScript code given here is not the most efficient.

Count A
Count B
Count C

 Show/Hide Analytic Solution