Maintaining Magazine Subscriptions
created by: Katrin Becker, 1989
The object of this assignment is to write a program that will build and maintain a list of subscribers to your magazine. An existing list is read in from a user-named file and sorted into alphabetical order. The user of the program may then make one of two requests:
-
- listall : print out the entire mailing list sorted alphabetically by name formatted as follows:
-
- Draven, Eric 10-2003
- Loft, Bleak Apartments
- BadPartofTown, SomeState
- U.S.A., Earth
-
- renew : given a month and year (of the form mm-yyyy), print out a sorted list of all subscribers who must renew in the given month.
- The original data is in a text file called subscribers and each 'record' has the following format:
- - you may assume input is valid
- - there is one field per line
- - there will be one blank line between records
- - "blank" fields are entered as '-'
- Last Name
- First Name
- Middle Name
- Title
- Street Address
- City
- Province
- Country
- Planet
- Renewal Date: in the form: MM-YYYY
- Eg.
- Draven
- Eric
- -
- -
- Loft
- Bleak Apartments
- BadPartofTown
- SomeState
- U.S.A.
- Earth
- 10-2003
-
- Each record will follow the next with exactly one blank line in between.
-
- A working version of this assignment is available in the course directory for you to try so you can see how it works.
-
- Minimal requirements for this program:
- To meet the minimal requirements your program must be able to read a single (possibly long) list of names and addresses from a specified file, and then be able to process the following interactive requests:
- 1. listall : print out the entire mailing list sorted alphabetically by name
- 2. renew 10-2002 : given a month and year (of the form mm-yyyy), print out a sorted list of all subscribers who must renew in the given month.
-
- Once a mailing list has been created it is to be written to a file (whose name is given by the user) so that the next time the program is run it can use this file as it's input file.
-
- Notes on Marking:
In order to pass it must work. (Some marks will be given to all *reasonable* attempts, working or not)
- For a Maximum Grade of C+:
- adequate, clean design;
- adequate documentation
- user interface reasonable?
- adequate testing?
- uses procedures; array of records
- sorts properly
- reads from predetermined file (name NOT specified by the user)
- displays list of subscribers on the screen
- displays list of subsccribers due to renew in a given month/year on the screen
- For a Maximum Grade of B+:
- All of the Above, PLUS:
- good, clean design;
- good documentation
- user gets to choose the names of the input and output files
- allow subscriptions to be 'renewed': i.e. change the renewal dates for spcified subscribers
- For a Maximum Grade of A:
- All of the Above, PLUS:
- excellent design;
- excellent documentation
- allows for a default output file name that is built from the input file name (i.e. add or change the suffix to '.out')
- display lists one screenful at a time
- allow for full (all data in each record) or partial (name and renewal only) data to be displayed
- Bonuses (caution: some of these bonuses are quite involved):
- 1. Include one or more of the following added features:
- a : add a subscriber to list;
- r : remove subscriber from list;
- x : purge (remove all expired subscribers);
- l : print labels (format output so it will fit on pre-fab label sheet)
- n : start new list
- c : change the address of an existing subscriber
-
- 2. Set up the user interface menu-style allowing the user to choose one of several 'command' options' (like those listed above)
-
- 3. Allow the user to enter new subscribers from the terminal as well as from a file.
-
- 4. Implement the list as a proper linked list.
-
-
- The program must be fully documented and follow appropriate style constraints. You must provide sufficient evidence that the program compiles and executes correctly.
-