First you must calculate the amount of energy given by one dollar of coal:
[tex]1\$\cdot \frac{3.2\cdot 10^{10}\ J}{40\$} = 8\cdot 10^8\ J[/tex]
In order to express the result in MJ (megajoules), I'm going to use a conversion factor:
[tex]8\cdot 10^8\ J\cdot \frac{1\ MJ}{10^6\ J} = \bf 8\cdot 10^2\ MJ[/tex]