2/5 were sold in the morning. This is equal to 40% of the total. That leaves 60% leftover.
3/4 were sold in the afternoon. This is equal to 75% of the 60% leftover or 45% of the total (.6x.75).
The difference between the two sales is 24 cartons or 5% (45%-40%). If 5% is equal to 24 then you can cross multiply to see what is the equivalent number of cartons out of 100%.