OC Curve Program

One of my friends has asked me to help him write a program to calculate the "n" and "c" values (sampling size, accept number), only given alpha(confidence level) , beta(probibility of acceptance), p1(AQL) and p2(LTPD). I'm currently a computer science major that has taken a few statistics courses... but I couldn't finish the program in time. So, our school year has ended and I couldn't really help him out all that much. Honestly, we were both really stuck on this. But, I can't believe that it can't be done, so I'm simply asking:

How am I supposed to calculate those values with all that I'm given? When I was working on it, I looked all over the place, but they required so much more data that I couldn't figure it out... I'm not asking for programming help (I don't think that's here haha, plus I don't really need it :/ ) I'm just asking, what formulas would I use to calculate n and c? Or, is there any reading you could link that would tell me, because I hate unfinished programs...

Proof that school year is over: http://www.niu.edu/u_council/calendars/2012-2013/

So I'm not just doing this for hw or whatever, I'm seriously curious.

Thank you guys!