The program can be compiled with the following command:
g++ Account.cpp main.cpp -o account.exe -std=c++17 -lpthread
If you have followed all the steps as instructed, your code should compile successfully.
It's time to execute and observe how our program works!
Don't forget that the WITHDRAWER thread always withdraws INR 1000.00, while the DEPOSITOR thread always deposits INR 2000.00. The following output conveys this at first. The WITHDRAWER thread started withdrawing, followed by the DEPOSITOR thread that seems to have deposited the money.
Though we started the DEPOSITOR thread first and the WITHDRAWER thread next, it looks like the OS scheduler seems to have scheduled the WITHDRAWER thread first. There is no guarantee ...