Bug 279

Summary: Cannot handle input ending with space
Product: Group 9: Route Planning Reporter: zixuan.huang
Component: InterfaceAssignee: zhanjiang2-c
Status: RESOLVED FIXED    
Severity: enhancement CC: qiyuliang2-c, zhanjiang2-c
Priority: Normal    
Version: 1.0   
Hardware: PC   
OS: Mac OS   

Description zixuan.huang 2018-12-08 17:57:53 HKT
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 Sha Tin . Note that Sha Tin is a valid Station name and the input ends with an extra space.

Expected result: System output "Please choose service type:".
Actual result: Invalid Input!

I believe that, for a searching function, we should at least be able to accommodate some typo in the input that will not affect its meaning. An ending space is one of them.

Please add a function to filter the space and line-changer in the input.
Comment 1 zhanjiang2-c 2018-12-08 17:59:18 HKT
Your requirement is sound. Bug fixed.