Update C++ program for library management