Buy-a-PC: Optimal Purchasing Time Problem using dynamic programming implemented in C++