a) The rate at which electrical energy is transferred to thermal energy is equal to the power dissipated on the resistor because of the Joule effect:

b) We can find the total energy dissipated in 7 h:

The energy costs 0.05 $ per kWh, so the total cost of 5.93 kWh of energy is

$