been a while since i've done a problem like this so i might be wrong in the "work" aspect
your system starts with 1200J
you add 700J of heat-
add 700 to 1200
1200+700
and your system does 400J of work
since work is being done by the system, the energy is leaving the system hence you subtract
1900-400
the result is then 1500