Perl Exercises
123456:Washington,George:SR
246802:Lincoln,Abraham "Abe":SO
357913:Jefferson,Thomas:JR
212121:Roosevelt,Theodore "Teddy":SO
The student exam record file has the following format: Student ID, Exam number, Score on exam. Note that Abe is missing exam 2: (it is delimited with blanks).
123456 1 98
212121 1 86
246802 1 89
357913 1 90
123456 2 96
212121 2 88
357913 2 92
123456 3 97
212121 3 96
246802 3 95
357913 3 94
The desired report:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Put the two records into two text files and write a program to produce the desired output as shown above. Display outputs sorted by the first exam results and total scores.
dictionary.txt
that contains
dictionary definitions, one per line, in the format ``word space
definition''. (Here's a
sample) Write a program that will look up a word
from the command line. (Hints: @ARGV
is a special array that contains your command line arguments and you'll
need to use the three-argument form of split()
.) Try to enhance it so that your dictionary can also contain
words with multiple definitions in the format ``word space
definition:alternate definition:alternate definition,
etc...''.
fix_phone()
sub that will turn all
of these numbers into the standard format ``(123) 555-1234'' or ``(123)
555-1234 Ext 100,'' if there is an extension. Assume that the default
area code is ``123.''