Upload Problem 6. Coded in C++