Fall 2006

Clay Shields


front | classes | research | personal | contact

Caterer Cook Calculator

Assigned October 24th
Program source code due: November 2nd

Sid of Sid's Itinerant Compact Kitchen was pleased with your last work, and wants you to extend it to be more useful. He would like to be able to process many different wedding orders more easily when he is placing his food order with the grocery wholesaler. He will still be using the same files as the last project, only he wants more functionality.

What he needs is a menu-driven program that would allow him to enter lots of different files, get a guest count, and get a count of how many of each type of meal he should shop for. To help you out a little, he has acquired a program design that just needs some fleshing out.

Your assignment

You are to use the basis of the program you are given to complete all functions to make each function work as described in the comments. You can download the body of the program or you can copy it to your account on seva by typing:

cp ~clay/sick.cc ./

You can test and copy the functionality of a program that does this by logging onto seva and typing ~clay/sick. The data files will be exactly the same as we used in the last project.

THERE IS NO DESIGN DOCUMENT FOR THIS PROJECT. This is good and bad. It is good because you don't have to turn it in, and bad because most of you won't do it. I would at least sketch out the algorithm for each function before writing it.

HINTS: Do not attempt to do all the functions at once. I would do them one or two at a time, going in this order:

  • First, complete load_file and display_lists.
  • Test to make sure these work before going on.
  • clear_lists
  • Test again.
  • count_guests
  • Test it.
  • total_food_items
  • Test.
  • And lastly, print_guest_list.
  • Final test.
If you have all these working, and you want a challenge, make a backup of your program, then try to rewrite print_guest_list so it prints the names in order by table. No extra credit, but you get to show off.

You will submit your source code. Include the following header in your source code.

    //
    // Project 3
    // Name: <your name>
    // E-mail: <your e-mail address>
    // COSC 071
    //
    // In accordance with the class policies and Georgetown's Honor Code,
    // I certify that I have neither given nor received any assistance
    // on this project with the exceptions of the lecture notes and those
    // items noted below.
    //
    // Description: <Describe your program>
    //
    

You will submit your source code using the submit program. This is the .cc file. Do not submit the compiled version! I don't speak binary very well.

To submit your program, make sure there is a copy of the source code on your account on seva. You may name your program what you like - let's assume that it is called sick.cc. To submit your program electronically, use the submit program like we did in prior projects, but with the command:

./submit -a p3 -f sick.cc