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.
- As implied, if the name of a file is passed in on the
command line, you must first parse this file and store all the
information contained therein.
- Each of the above tasks must be implemented in their own seperate
subroutine. You may choose to provide a prototype for these
subroutines, but it is not required. You may also write more
subroutines than those listed above, if you so choose.
- Within your program, you must make good use of a data structure of
at least two dimensions (ie, array of arrays, array of hashes, hash
of arrays, or hash of hashes). You may have more dimensions, and/or
more than one data structure, but one structure w/ at least 2
dimensions is the minimum requirement.
- Although I dislike making design requirements, I need to ensure
that the TAs can grade this assignment easily and quickly. Therefore,
the internal design of the program is up to you, but the user
interface must follow my specifications exactly. This is so that the
TA can create a sample run of your program and pass it to your script
via the shell. The specifics of this user interface are available here.
- For all subroutines that need to ask for a student, your program
must accept either the RIN or the RCS Id. You are not permitted to
ask the user which he will enter. Your subroutines simply ask "Which
student?". The user then enters the RIN or RCS Id, and your program
figures out which student is being referenced.
- An RIN is a nine-digit number. A RCS Id is a series of letters
optionally followed by one or more digits
Grading Criteria
| Parse file, if given | 5 |
| Print Student Info | 10 |
| Print all students, by Last Name | 5 |
| Print all students, by Average | 5 |
| Add Student | 10 |
| Remove Student | 5 |
| Add Grade | 10 |
| Change Grade | 10 |
| Save Changes and exit | 5 |
| (At least) 2-dimensional data structure | 10 |
| User Interface meets specifications | 5 |
| Compilation | 5 |
| Error Checking | 5 |
| Code Style | 5 |
| Output Style | 5 |
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