Let n be the number of calculators so each one cost 240/n. She sold n-1 calculators for $300 so each calculator was sold for 300/(n-1). The profit=5=300/(n-1)-240/n. Multiply both sides of the equation by n(n-1): 5n(n-1)=300n-240n+240. So 5n^2-5n=60n+240. This is a quadratic equation: 5n^2-65n-240=0. Divide through by 5:
n^2-13n-48=0; (n-16)(n+3)=0. So n=16, because n=-3 is not applicable in this case.
Let's see if 16 fits the facts. Each calculator costs 240/16=$15. She sold 15 for $300, making them $20 each. So she made a profit of 20-15=$5 on each calculator. That fits!