Question

In the system below, Nitrogen gas is being heated by Joule's effect. While applying the first law of Thermodynamics, will the energy exchanged between the gas and the environment be counted as heat or work? Explain your answer.

Question image 1Question image 2