Hi!
I am making a program for my final year School Project. In the program, I have to add a function that accepts a person's name and searches for it in a given data file. Currently, my function checks and displays if the name is present or not! I got that part right! But, there has to be a feature thats gives suggestions of names already existing in the data if exact match is not found. It is to display the person's name if the Input is 50% right. For example, If I have a name 'Jackson' in my data and I search for 'Jack', the function should display 'Jackson' as a suggestion!!
Can anyone please help me with writing the code for this function? Pleaseee!!!
Thanks for the Help in Advance!!!
Well you can also read each name individually into a character array, then use a for loop to check if the names are the same.
Then you can put a counter for every match of character there is, beyond a certain count may be like a certain amount of characters matched, then you can put that against how many characters are in the person's name to come up with a percentage.
Well, thank you so much for your help! I've got the Idea, but I need help in writing the code! Its really confusing!! Let me give it another try..........
Ok, here's what I got, it checks for name matches in a file, if it finds one it breaks.
The text file has to be placed in the same folder as where your .cpp source file is. It's named "blah" and it's a .txt file. Also, has names listed in a column, in other words: Type in one name, hit enter, type in another etc. So that the names are listed top to bottom, in the text file.