UC Irvine, Information and Computer Science Department

ICS 54 Winter 2000: Homework 5

This assignment is to be done individually.
All work for it should be done in a special directory (on a UCI UNIX system, either ICS or OAC-EA) which you set aside for the purpose which contains no other work and which you keep for future reference and use in this course.
Suggestion: Have a ics54 directory and put the work for this assignment in an ics54/hw5 subdirectory.
This assignment is due at the start of class, Monday, March 6.
You will turn in a printout with a separate cover/title page containing:
(1) Your Personal Identification (Name, Student ID number, and UCInetID),
(2) Assignment Identification (course name and quarter plus assignment number).
Please print separate parts of the assignment on separate sheets and label the pages appropriately.

The TA will be available in CS 364 at the following times:

The Instructor will also be available in his office (Engineering Gateway 2149) during the following hours as well as at other times by arrangement:
  1. You have grade reports from Math101, Biology121, and Philosophy102. Each file contains columns specifically for student's name, ID and final grade (grade ranges from 0.0 to 4.0). Suppose that each file has exactly the same students, although not necessarily in the same order.

    Create a shell script, GradeReport, which combines the information from these three reports into a single one which has 5 columns: student ID, name, and grades from each of the three courses. The report should be sorted according to student ID.

    You need not check that the files have the same names for the same IDs, but if you want to note any discrepancies (as a nice extra touch) do so, keeping the first name encountered as being the correct one.

    For this part, you should submit a well commented listing (WCL) of GradeReport, the grade reports you created for your sample run, and your sample run showing how (well) it works. Your sample reports should have at least 20 students from at least 4 majors. Of course, the grades should be reasonably distributed. Include also (of course) an explanation of the sample runs, stating how they show that your script works well.

     

  2. For this part, create a shell script, GpaReport, which takes as input the output of the GradeReport script of part 1. GpaReport computes the GPA of each student for the three courses reported. Assume that each course is worth of 3 credits. For each student, the report should have a single line with that student's name, ID, and GPA in the first 3 columns plus a fourth column with a single character determined as follows: "!" if the GPA is below 2.0, "$" if the GPA is above 3.7, and "*" otherwise.

    For this part, submit the same type of WCL and sample runs with explanations as you did for the previous part.

     

  3. Create a shell script, GpaMail, which takes as its input both the output of GpaReport (from part 2) and another file containing a list of student information (one student per line): ID, e-mail address, and major. GpaMail computes the average GPA for each major and then creates e-mail messages to be sent to each student advising that student of his/her GPA and the average for his/her major. If the grade is below the average for the major, the message should include an appropriate notification (e.g., "Watch out, GPA is below average for your major!").

    For this part, submit the same type of WCL and sample runs with explanations as you did for the previous parts.

 

Note:

This homework requires solutions related with awk. Functions may be considered as necessary.

For all 3 parts (scripts), your solution may well create some intermediate file(s). If so, they should be named in such a way that you could run more than one copy of the program at the same time, and they should be deleted when the script exits. You need not actually send the e-mail. It is sufficient that you echo to the screen a line giving the command that would e-mail the message to the given address.

 


Comments are welcome.
Current as of 21 February 2000
HTML 4.01 Checked.