Week 14: Exercises

1. Vowel Words

Write a program that finds all words in the input that begin with a vowel A, E, I, O, or U (which may be in uppercase or lowercase in the text). Write all these words in sorted order to standard output, with no duplicates. Use a regular expression for matching words.

2. Time Expression

Write a regular expression that will match any day/time in this format:

Feb 2 2024 10:08:24

A month will always be written with the first letter capitalized and the remaining letters in lowercase. The year and seconds are optional, so e.g. the following day/time is also valid:

Feb 2 10:08

3. Movies

Modify the movie program we wrote in the lecture so that if the user specifies an argument -l (for length), -s (for score) or -y (for year), the program will print out all movies from the dataset, one per line, sorted by the specified attribute. Each output line should contain a movie's title, year, length and score.