University of Calgary

Bicycle Registration System

Bicycle Registration System
source: Katrin Becker, 1987

This time, your job is to develop a Bicycle Registration System. This system will be run strictly in a batch environment (i.e. this is not an interactive program; all I/O is done through files).

The data is maintained in a "Master File" which must be read in completely at the start of each run and re-written at the end. (see BRS.master  in the course directory). Information in this file consists of a name (last_name, first_name), the type of bicycle being registered, and a 4-digit serial number. One individual may register more than one bike but each serial number should be unique.

Updates to the file are made in the program using script files which consist of a series of requests (see BRS.script1 in the course directory). These requests can take the following forms:

NEW Fold, Bill BMX 1001 - which represents a new registration
OLD Pass, Hope.I. - which represents a renewal of an existing registration
OLD 2001 - which also represents a renewal of an existing registration
DELETE Perman, Sue - which represents a registration to discontinue
DELETE 2010 - another discontinued registration

Acceptable Bicycle types: Mountain, Racing, 10-Speed, BMX, 16", Tandem

This system is to produce two output files: 1) the updated master file (which can have the same name as the one used for input), and 2) a log file where the input requests from the script file are echoed and where errors and problems encountered during the run are reported.

MINIMUM REQUIREMENTS:

  1. read in master file
  2. add new registrations
  3. process renewals and deletions by one of serial number or name (your choice; be consistent)
  4. if processing by name only, then first match is sufficient when there are > 1 bikes for that individual
  5. duplicates are not permitted (new registration of a bike that already exists)
  6. all input may be treated as character (strings)
  7. trap and reject requests for renewals and deletions of bikes that don't exist in the database

BONUSES:

  1. if processing renewals/deletions by name and that name has > 1 bike, the request should be rejected
  2. use of record structures to impliment the 'database'
  3. allow requests to be made using either name or serial number
  4. sort the master file
  5. use of Pascal sets for bicycle type
  6. notice all duplicates and reject duplictae or redundant requests)
  7. print a summary of how many bicycles of each type are registered in the log file at the end of each run
  8. keep track of the number of transactions (by total and by category) to print in the log file at the end of a run



Updated: August 31, 2005 03:08 PM