A) Total revenue is the product of the quantity sold and the price at which they were sold.
(total revenue) = Q*P
= Q*(24 - .5Q)
= -.5Q^2 + 24Q
This quadratic function will have a maximum at Q = -24/(2*(-.5)) = 24
Total revenue will be maximized when Q = 24.

B) The profit on each unit is the difference between the selling price and the cost. The total profit will be the product of the unit profit and the number of units sold.
(total profit) = Q*(P - AC)
= Q*((24 - .5Q) - (Q^2 - 8Q + 36 + 3/Q))
= 24Q - .5Q^2 - Q^3 + 8Q^2 - 36Q - 3
= -Q^3 + 7.5Q^2 - 12Q - 3
This will be maximized when the derivative is zero.
-3Q^2 + 15Q - 12 = 0
Q^2 - 5Q + 4 = 0 (divide by -3)
(Q - 1)(Q - 4) = 0
This suggests that quantities of 1 or 4 will maximize profit. Using our equation for total profit, we find that profit for Q=1 is negative. Profit will be maximized when Q = 4.
Here is a plot of profit versus quantity sold.