UMBC CMSC 201 Fall '00 CSEE | 201 | 201 F'00 | lectures | news | help 

CMSC 201
Programming Project Five

Meals

Out: Monday 11/27/00
Due: Before Midnight, Sunday 12/10/00

The design document for this project, design5.txt
is due: Before Midnight, Sunday 12/03/00

The Objective

The objective of this assignment is to give you practice with project and function design. It will also give you an opportunity to work with linked lists, reading information from a file, using dynamic memory allocation, and dealing with command line arguments.

The Background

An important activity in any household, is the planning and serving of balanced meals to the family. This process begins when you visit the grocery store to purchase items to stock the pantry. Even if you are not currently concerned about how many calories, or grams of fat, or milligrams of sodium you are consuming each day, there will come a time in your life when you will have to be aware of such things, either for yourself or some member of your family.

My local grocery store provides a book called the "Food Guide" for under $3.00. This book has listed the nutritional data for almost every item they sell. This includes information on pre-made items, mixes and kits, canned or frozen foods, as well as fresh meats, seafood and produce. This book can be used along with your family recipes to construct the nutritional data for each dish you prepare.

Meals can be constructed from these food items that are available in your pantry and totals of the nutritional data can be calculated, so that you'll know how many calories, sodium, etc. each person will consume if they have one helping of each item.

The Task

Design and code a project that will allow you to read in the information from a text file, create linked lists of those items by type (MEAT, STARCH, VEGETABLE, FRUIT, or DESSERT) to represent the pantry, allow the user to build meals from these items (also linked lists) and report the nutritional data for the full meal. The user can create as many as 7 meals, one for each day of the week. I have restricted the food items in the file to be those typically served for dinner.

The Specifics


See the sample output for a suggested format. The contents of the text file is a list of food items and their nutritional information. Each food item has the following form in the file: