Recall that one dozen is equal to 12. Then, 2 dozen = 2 × 12 = 24.
To find the cost of all 24 pencils, we multiply 24 by the cost of one pencil, which is 40 cents.

Henceforth, the cost is 960 cents.
To convert to dollars, divide by 100. You get
.
Answer:
The cost is $9.60