Question

2-21C When is the energy crossing the boundaries of a closed system heat and when is it work?

Fig: 1