add the task 3 code in main.cpp; and fix bug for barterer & buyer