java program simulating the everyday working of this train system