Question: Correct answer will receive a thumbs up. This is in C-language. Write pseudocode and translate it to C-program for the following problem. Consider a text
Correct answer will receive a thumbs up. This is in C-language.
Write pseudocode and translate it to C-program for the following problem. Consider a text file. Each line of the file has the following form: firstName lastName An example of the file, with name example. txt, is Allen Turing John McCarthy Dennis Ritchie Brian Kernighan Your program will ask a user to provide a file name and then go through the names in the file and print to the screen the full name whose last name is the greatest in dictionary order. One example execution of your program is: Please input the file name: example.txt The full name whose last name is the greatest in the file is Allen Turing. You can assume NO two last names are the same in the file. (You are welcome not to use the assumption. Without that assumption, it will be more challenging and you need to give your tie breaker criteria when two full names share the same greatest last name.) When you compare two strings, DO NOT use the library function. Use the following one: Function name: compareStr input character pointers: s1, s2 (i.e., const char *s1, const char *s2) output 0: the string in s1 is the same as that in s2. -1: the string in si is less than that in s2. + 1: the string in s1 is greater than that in s2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
