modified on 28 November 2006 at 02:45 ••• 1,180 views

From PaulGuWiki

Jump to: navigation, search
Mark Maintenance
Mark Maintenance

The program stores the data in a fixed length (80 bytes) record file, the name of which may be specified as a command line parameter. If no file name is given, the file "btp300a.dat" is used. If the file already exists, the pre-existing data is made available for updating, otherwise a new file is created. The record layout for this file is:

  • bytes 0-41: Name stored as a null-terminated string
  • bytes 42-51: Student ID stored as a null-terminated string (digits only)
  • bytes 52-67: Assignment raw marks stored as 4 ints, each in tenths of a mark out of 100. For example, an assignment mark of 7.5 out of 10 will be shown on screen as 7.5, but will be stored as the integer 75, thus only 1 decimal place of accuracy will be stored.
  • bytes 68-75: Test raw marks stored as 2 ints, each in tenths of a mark out of 200. For example, a test mark of 14.5 out of 20 will be shown on screen as 14.5, but will be stored as the integer 145.
  • bytes 76-79: Final exam raw mark stored as an int, in tenths of a mark out of 400. For example, a final exam mark of 30.5 out of 40 will be shown on screen as 30.5 but will be stored as the integer 305.

Data entry/maintenance takes place on a screen which allows the user to enter and update all the data for a single record. The PageUp and PageDown keys are used to move from one record to the next. The data is saved to file whenever the user moves to another record, presses Enter on the last editable field of the screen, presses F2/F3 to move to another record (see below) or exits the program.

The Student ID is to be digits only (although it could be left empty), and the various marks should be validated to be in the proper range (-1.0 to 10.0 for assignments, -1 to 20.0 for tests and -1 to 40.0 for the final exam). A negative mark indicates that that score is not yet available.

As well, the data entry screen shows the overall average achieved by using the following weights: assignments - 7.5% each, tests - 15% each and final exam 40%. The average is shown two ways: as a number of percentage points earned out of the total available percentage points for the semester, and as a percentage of the percentage points for which scores are available. For example, if there are are only the following scores: assignment 1 - 10 out of 10, test 1 - 20 out of 20, then 22.5 out of 22.5 would be shown (since the student has earned all of the 22.5 percentage points available so far), as would 100% (since the student's average has been 100% of everything written so far). Note that negative marks do not factor into these calculations, but simply denote how much of the coursework has been completed.

The screen also displays the record number on the screen, where the first record on file is considered to be record number 1.

If the file is empty or the user presses Page Down on the last record, a new record is presented for editing with an empty name and ID, and with -1 for all the marks.

Finally, the F1 key provides field-by-field context sensitive help, and the F2 key is used to ask the user to enter a record number, and (as long as that record number is on file) then presents the user with that record. The F3 key moves to a new record to be appended to the end of the file.

The program is terminated by pressing the F4 key or by pressing the Escape key. In the case of the Escape key (which also undoes editing of a field), the user is presented with a confirmation message asking to make sure that the program should stop, giving the user the option to stay in the program.

This program will work on three platforms:

  • Windows XP
  • Linux
  • IBM AIX