Some kind of program

 
Hey here, Is there any kind of program which will calculate total loss and total profit separately?