>
CS 1323 Honors, Fall 1996

Team Project C
Catalog Sales Report

Due Wednesday, October 23, 4:30pm, FH303

What to Hand In

Project Description

Construct a Haskell program that displays a catalog sales report based on data contained in a file. The program should ask the person at the keyboard to enter the name of the file containing the sales data, then display the report on the screen.
Catalog Sales Data File
The sales data file will contain a sequence of customer orders. The data record for each customer order will begin with a line containing the customer's name, then a line with the street address, a line with the city, state, and zipcode (this line will meet the specifications of Individual Project 5A), a line with the date (a la Individual Project 5C), and then a sequence of lines containing item entries (a la Individual Project 5B).

Note that the customer may order many items, and all of these items will be listed on separate lines within the data record for that customer. The last item in the sequence will be followed by an empty line, which completes the data record for the customer order. Exception: It may happen that the data record for the last customer order in the file is not followed by an empty line. That is, there definitely will be an empty line between the data record for the first customer order and the record for the second, between the second and the third, and so on, but there may or may not be an empty line after the data record for the last customer order.

Catalog Sales Report
The sales report will have two sections, one listing the customer orders by zipcode (small zipcodes preceding large ones) and another listing them by date (earlier dates preceding later ones).

By-zipcode Section. The by-zipcode section of the report will list all customer orders, including name, address, date, and items, and it will also include, along with each customer's record in the report, the total dollar-value of the items that customer ordered. The dollar value must be displayed prominently, yet tastefully, at the bottom of the customer's record in the report, with a dollar sign and two decimal digits, as dollar amounts are customarily displayed. Customer orders will be separated from each other in the report by blank lines.

By-date Section. The by-date report section of the report will list only customer name, address, and date.

Date lines, city/state lines of addresses, and item lines in reports must be displayed in standard form, as described in Individual Project 5).

Program Organization

Ground Rules

Cautionary Note: Previous team projects have required assembling components produced in individual projects, but have required very little in the way of designing an overall organization for the program or in designing and constructing new components. This team project requires all three elements: design of program organization, design and construction of new components, and assembly of existing and new components. Last Modified: