UMBC CMSC201, Computer Science I, Spring '98

Project 4: ACME Home Improvements

Due date: Tuesday, April 28, 1998

You have been hired by ACME Home Improvements, Inc. to write a program that allows the secretaries to send out form letters to potential customers, using the data found in ACME's customer file. ACME's owner wants to save on the mailings by targeting different letters to specific areas of the city.

Example scenarios might be:

This project will give you practice with structs, manipulating strings, file-handling, command-line arguments, and of course design and separate compilation.

Description of the Program

In order to use your program, the secretary should enter the name of the executable, the name of the file that contains the form letter to be used, and the name of the data file that contains the customer records. At this point the user should be presented with a menu that allows him/her to choose from several options. Generate form letters using "filename.txt" for A - All customers I - Individual customer S - Specify customers by zip code and/or type Q - Quit Enter your choice : where choosing 'A' will immediately start generating form letters, one for each customer in the file;
choosing 'I' will allow the user to enter a specific company name for commercial customers or lastName for residential customers and generate only one letter for that customer;
choosing 'S' will prompt the user for as many zipcodes as s/he wishes, and also give the user the option of picking all customers, only residential customers, or only commercial customers in those areas. All of the customers of the type chosen, in each of the zipcodes entered, will have a form letter produced for them;
and choosing 'Q' allows the user to quit.

After choosing any of these options, the appropriate action should take place and then this menu should be presented to the user again. The user must choose Q from this menu to end the program.

The records of the customer file are kept in ascending sorted order on customer number (custNo) and has the information stored for each record in the following order:

custNo (int), custType (1 char), companyName (max of 25 chars), lastName (max of 15 chars), firstName (max of 15 chars), salut (max of 5 chars), houseNumber (int), streetName (max of 25 chars), city (max of 20 chars), state (max of 2 chars), zip (max of 5 chars)

where the customer type is a single character, either a C (for commercial) or an R (for residential). If the customer type is C, there will be a company name in the companyName field, as well as the first and last names of the person to contact at that company stored in the firstName and lastName fields. If the customer type is R, the companyName field should contain a single space. The fields of the file are separated by commas, and the contents of the fields themselves are restricted from containing commas.
Example record for each customer type:

104,C,ABC Sales,Smith,Everett,Mr.,11350,McCormick Rd.,Owings Mills,MD,21117 217,R, ,Browning,Samantha,Dr.,1756,N. Charles St.,Baltimore,MD,21201

Design limitations and details


Sample Output

Watch this space for a link to sample output.

Copying the files

The files you need to use for this project are called waterproof.txt, paint.txt, and customer.dat. They are found in my 201 directory, ~sbogar1/201 You should copy these files into your own directory. The executable and the data files need to be in the same directory.

Submitting your project

Submit your projects as usual, using the submit command.