c++ program for housekeeping