Fall 2006 |
Clay Shields |
Caterer Cook Counter
Assigned: October 5th |
Sid runs a wedding catering company named Sid's Itinerant Compact
Kitchen. He has a mobile kitchen that can arrive at events, set up
4 tables of 16 seats that are carried within, and then serve a
delicious dinner. His menu is simple, as he makes four different
types of dishes from beef, chicken, fish, or vegetables for each
meal. In order to help him prepare a delicious wedding feast, he
asks his guests to provide him with a file that describes who is
coming, which menu item they want, and the table number where they
are sitting. To make his life easier, he wants you to write a program that will take one of these files and count up how many of each dish go to each table, and how many total of each dish he will need. The files that he will give you will all have the same format, and will consist of many lines of data each with a table number, a food item, and a guest name. The table numbers will range from 1 to 4, the food items will be one of beef, chicken, fish, or veggie. The guests name will be whatever the guests name is, and can be of any form. An example guest file is show below:
1 fish Marylyn Fulton 1 beef Dr. Janeka Ling 1 beef Katherina Sandys 1 veggie Clement Drabble 2 chicken Reina Sidower 2 fish Lyssa A. Newton 2 veggie Baptist Greif 2 chicken Abby Powell 2 beef Mackenzie Schuth 3 beef Amanda Stanfield 3 chicken Orrell Carr 3 veggie Leia Muller 3 veggie Bert Woodworth-Smith 3 fish Winnifred Sachse 4 beef Pearle Finck 4 chicken Steven Mortland 4 fish Carine N. Ruhl 4 chicken Julia Crom 4 fish Amice Tavoularis 4 veggie Heath Canham Your assignmentYou are to write a program that will ask for the name of an guest file to read. The program will then calculate the total number of each dish for each table and the total number of each type of dish. Below is the output of a program that does this:seva% ./dishesYou will be able to run the version of the program that does this by logging onto seva and typing ~clay/dishes. I will post an update to this page when I make this available.
UPDATEYou can now run my version of the program on seva by typing:~clay/disheswhen asked for the filename. You can also copy the guest file to your directory by typing: cp ~clay/guests ./ Part 1 - Design DocumentFor the first part you are to submit a design document showing the algorithm you plan to implement.DO NOT SUBMIT A FLOWCHART. I won't grade it. Instead, write it out neatly using a language which is similar to that from Homework 1 and has the following terms:
statement ... statement end A copy of your algorithm is due in class. Be sure to keep a copy for yourself!
Part 2 - Program Source CodeImportant: Your output and input should be very similar to that shown in the example program. Please ask for the input in exactly the same order shown and only request the same items shown - do not ask for any other input. This will assist in grading your program.Include the following header in your source code. // // Project 2 // 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 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 dishes.cc. To submit your program electronically, use the submit program like we did in Homework 2 and Project 1, but with the command: ./submit -a p2 -f dishes.cc I will not be enabling the electronic submission until after the design documents are in, so don't try to submit too early. |