Here are the signs of ΔE for each process:
a) If an endothermic process performs work, and the magnitude of work is greater than the magnitude of heat, then ΔE is negative.
b) If work is done on a gas and the process is exothermic, then ΔE is positive.