Just to have a look a name in a list, when match, the value is discounted.
I tried to code, but the matching technique is fail. Like I try to find "John", but it match with "John" and "Johnny", whether the expected match is just "John" (case is not sensitive)
Just want to help my mom's store. What I want is something like: I have 3 set of flat file (list1.txt, list2.txt, list3.txt). Each file has its name, for example:
John
Rudy
Barrack Obama
John Travolta
List2.txt contained:
Jeddi Sarah
Mute Sand
List3.txt contained:
Greedy Black
Nevada Blue
The program when executed, ask:
Enter name: Greedy Black
Enter price: 1000
If the name is listed in list1.txt, he gets discount price 10%, list2.txt for 20%, and list3.txt for 30%. example output:
Enter name: Greedy Black
Enter price: 1000
Greedy Black is found in list3.txt, got discount for 10%
price after discount: 900
But if he does not in any list, he gets normal price, which is 1000. How could I do that in C? Thank you for the help...