1. Write a Perl script that converts a Latex expression of the form {\em Brad} to an html expression of the form <i>Brad</i>. Any sequence of characters, digits, punctuation, whitespace, and newlines can be between the braces.

  2. Write a Perl script that finds all the words in a file that begin with the letter b and end with the letter d or t.

  3. Write a Perl function named power that takes two arguments, base and exponent, and returns the result of raising base to that exponent. For example, &power(2,5) should return 32.

  4. Write a Perl script that reads stock transactions from a file, type checks them, aggregates them by ticker symbol, and then writes the good records back to a second file. In the output, each company will also have a final line that summarizes the transactions. The input and output files will be command line arguments. The format of a stock transaction is:
    ticker symbol, transaction type, quantity, price, mm/dd/yyyy
    The appropriate types for each field are as follows:

    If a line has a type error print out the line and an appropriate error message(s). If a line has more than one error than you should print all error messages.

    As noted above, you should aggregate all the transactions for each stock ticker symbol and write them out. You do not have to write them out in alphabetical order (hint--this means you might want to consider using an associative array). Change the date fields so that they print out as mm-dd-yy. There should be an empty line between each group of transactions (each ticker symbol represents a group of transactions) and the data fields should still be comma separated. The summary line should read:

    total transaction value = $xxxxxx.xx
    where there are two decimal digits and space for up to six digits to the left of the decimal point (if the total transaction value is greater than $1,000,000 that is ok--the field will simply print larger and not be aligned.