CS 1323 Honors, Fall 1996
Team Project D
What to Hand In
Catalog Orders File
Due Wednesday, December 4, 4:30pm, FH303
Program Organization Chart
exhibiting the interactions between major program
components. Attach a report to the chart
providing a rationale for the program organization.
(Why does it organize the parts of the computation
in a coherent way? How does it facilitate independent
work on different parts of the program by different
of the program
your team writes for this project
This leads to the creation of
a file containing, in standard form, data that has been
entered from the keyboard.
- a listing of the file your team's program creates
of team meetings
Construct a C program prompts the person at the keyboard
for catalog orders and creates a file containing those
In the file,
each order will consist of a person name (line 1),
street address (line 2),
city, state, and zipcode (line 3),
a date (line 4), and
a sequence of items (one per line, lines 5 to n),
then a line containing the total dollar amount for the order
(computed from the amounts entered on the item lines),
and finally an empty line.
Order information will be entered from
the keyboard in the same way as in
Individual Project 9,
and entries in the file will conform to the standard forms
specified in that project. You will have to decide how
to terminate the entry of items for individual
customers and how to terminate the entry of customer orders.
The program must be organized as a collection of modules.
Your team is responsible for designing the modular
organization. The organization should provide a coherent
logical context that communicates the structure of the
computation, and it should facilitate independent work
on parts of the program by different people.
- In each team project, certain team members will
These assignments will rotate
with each successive project. For this project,
the assignments are
Team Organization document
outlines the duties associated with these assignments
- leader - fourth team member listed on roster
- recorder - first (fifth for Team Reid)
- librarian - second member on roster (first for Team Reid)
- collector - third member on roster (second for Team Reid)
- Use modified forms of the functions your team members
defined for Individual Project 9 to retrieve city-lines,
date-lines, and item-lines from the keyboard, and to
write standardized forms of those lines to the data
file the program creates:
- In Project 9, none of the functions had parameters.
In this project, all of them will have one parameter,
which will be a handle (type FILE*) for the file being created.
Also, instead of
sending the information entered to the screen, the
functions will write the information to that file.
- The item-line function will have an additional
modification. In addition to writing an item line in
the file being created, it will deliver as its value
the price of the item, represented as a number (not
- To convert from the string, which was
entered on the item line
and written to the file, to the number to
be delivered as the value of the function, use
the atof function:
- #include < stdlib.h >
- ... other statements ...
- char price;
- double priceAsNumber;
- ... statements that associate a string with price ...
- priceAsNumber = atof(price);
- ... at this point, if price is the string "29.95",
then priceAsNumber is 29.95 ...
- Read the document on
compiling and running
programs with multiple modules to find
out how to compile and run your program.
- As usual, follow the standards required in the
Project Style Guide