Write a program to read a list of filenames, breaking each name into its head and tail components. (Everything up to the last slash is the head, and everything after the last slash is the tail. If there's no slash, it's
in the tail.) Try this with things like
. Do the results make sense?
Write a program to read in a list of numbers on separate lines, and sort them numerically, printing out the resulting list in a right-justified column. (Hint: the format to print a right-justified column is something like
Write a program to print the real names and login names of the users in the
file, sorted by the last name of each user. Does your solution work if two people have the same last name?
Create a file that consists of sentences, one per line. Write a program that makes the first character of each sentence uppercase and the rest of the sentence lowercase. (Does it work even when the first character is not a letter? How would you do this if the sentences were not already one per line?)