Programming in Perl

Homework 4

Due Friday, November 8, 11:59:59pm EST

Check the FAQ often.
Also available now are:
Input/Output Scripts,
Data::Dumper information,
User Interface specifications

Imagine you're a new grad student in the CS department. You suddenly get an email from the department's Executive Officer that you will be teaching an undergraduate class with max enrollment of 120 students. And by the way, it starts in two weeks. Trust me, it could happen.

Being the intelligent grad student that you are, you want to develop a computer program to record student grades, rather than a pencil & paper system. And of course, being that you're so intelligent, you want to use Perl.

Write a Perl script that will implement this grading system. In particular, you must define subroutines to do each of the following tasks:

Print student info

This subroutine will ask the user for which student to give information about. It will then print the student's first and last names, RCS Id, RIN, homework grades, and exam grades. You must then compute the student's final grade by using a 60/40 and 70/30 method (print the grade by both methods).

Print all students

This subroutine will ask the user to sort the list by either the Last Name or by the final grade. Then for each student, print the student's first and last name and the final grade (the max of either the 70/30 or 60/40 method).

Add Student

This subroutine asks the user for the new student's last name, first name, RCS Id, and RIN.

Remove Student

In this subroutine, ask the user which student to remove, and remove that student from the system.

Add Grade

This subroutine first prompts for which student to add a grade for. Then ask the user if he/she wants to add a homework grade or an exam grade. Finally, take in the new grade.

Change Grade

First, ask for which student. Then show all grades. Ask if the user wishes to change an exam or homework grade. Then ask which grade to change, and finally take in the new value for that grade.

Save Changes and exit

When the user selects this option, you must write all students' information to a database file. If the program was intially run by taking in a file on the command line, you must write the updated information to this same file. If not (ie, you started with no information), prompt the user for the name of a file, and print the information to this file. You may choose any format for your data file, so long as your program can read and parse it again the next time it is run.

Notes and Requirements

Please read this list carefully.

Grading Criteria

Parse file, if given5
Print Student Info10
Print all students, by Last Name5
Print all students, by Average5
Add Student10
Remove Student5
Add Grade10
Change Grade10
Save Changes and exit5
(At least) 2-dimensional data structure10
User Interface meets specifications5
Compilation5
Error Checking5
Code Style5
Output Style5
As normal, 5 Above & Beyond points are available. Please note that your A&B contributions may NOT adversely affect the way the user interface script is run. You may create more menu options that can be tested manually and independently, but do not change any menu options or their input/output requirements.

Submission Instructions

As always, you can submit either via the RCS program ~lallip/public/submit.pl or online. A couple notes about the submissions:
First, please, DO NOT type any notes or comments into the field for Above and Beyond descriptions. If your program does not have an above and beyond attempt, leave this area blank. If you need to include notes or comments, put them at the beginning of your code, or email me.

UPDATED: 10/29/02

Second, if you choose to write your own class(es) to do this assignment, you will need to submit multiple files. In order to do this, you must submit via the RCS program ~lallip/public/submit4.pl. The normal RCS and CGI submission programs will not allow you to submit multiple files.
This program is significantly more complicated and involved than any of the previous three. That is why you have an extra 3 days to complete the assignment. I strongly suggest you do not wait until the last day to start this.
The assignment is due Friday, November 8th, at 11:59:59pm EST. Your program must run on rcs-sun1.rpi.edu