Due: September 7, 1999
(1) Write a simple Perl program to read in a text file of student grade and print out a student report. Each line of the input file contains one student taking one course. An example:
h2q1dat.txt:
CSCI4230,123456789,A
CSCI4333,123456789,B-
CSCI4533,123456789,A-
CSCI4132,200000000,A-
CSCI4333,300000000,C+
CSCI4132,123456789,A-
CSCI4634,123456789,B+
CSCI4634,200000000,A-
CSCI4333,200000000,A
CSCI4230,300000000,C+
CSCI4534,300000000,B+
CSCI4230,444444444,A
Assume that there is no syntax error and each field is comma separated. The first field is the course. The second field is the ss# of the student.
Running your program should generate the following report:
MyAoount>h2q1.pl
Please input file to be process => h2q1dat.txt
Student report
==============
student 123456789 has a GPA of 3.46668 and
has taken 5 courses: CSCI4230, CSCI4333, CSCI4533, CSCI4132, CSCI4634.
student 200000000 has a GPA of 3.7778 and
has taken 3 courses: CSCI4132, CSCI4634, CSCI4333.
student 300000000 has a GPA of 2.66663333333333
and has taken 3 courses: CSCI4333, CSCI4230, CSCI4534.
student 444444444 has a GPA of 4 and has
taken 1 courses: CSCI4230.
It is not necessary to pretty print the GPA and rounding errors in GPA are acceptable.
(2) Write a small Perl program to read in a dictionary text file, which contains one word per line and output to a text file, result.txt, that contains words with 12 or more different characters. For example, the word insurmountable has 12 characters, i, n, s, u, r, m, o, t, a, b, l and e, and should thus be included.