Assignments written in C++ and Javascript