Step to reproduce: 1. Run the program. In the "Route Planning System" menu, input 2 to choose "Get facility info". Then in the "Get facility info" menu, input 1 to choose "Search a facility". 2. For "Please enter station name:", input Wong Chuk Hang. 3. For "Please enter facility type:", input 1 to choose WIFI. 4. System output "Do you want to search nearby stations?", input 1 to choose Yes. Expected result: The firstly adjacent stations of Wong Chuk Hang is Ocean Park and Lei Tung, both of which do not have WIFI service. So the algorithm should search for the secondly adjacent station of Ocean Park and Lei Tung, which are Admiralty and South Horizons respectively. Both stations have WIFI service, we are expecting the output to be Admiralty South Horizons Actual result: Admiralty I haven't looked at the code yet, but I am sure that in the searchFacilityNearStation() function you have stopped somehow after getting the first result.
Fixed. Actually the function did not stop after getting its first result. When it is looping the adjacent stations, namely Ocean Park and Lei Tung, of the current station Wong Chuk Hang, it stopped after checking only the first adjacent station of Ocean Park and Lei Tung, which, in this case, is Admiralty and Wong Chuk Hang. And only Admiralty has "WIFI" service. Anyway, the bug is fixed now.