Requirements
This assignment has two parts: a report and the implementation of the solution.
Report
For the report portion, you must generate documentation, in PDF format, describing your system. The purpose of this is for you to explain not just what your system is doing, and how it is doing it, but why. You will need to justify your design decisions in a concise, informative manner. Justifications such as "I did this because it was easy" are not sufficient, as you should actually explain why a particular data structure or algorithm was more efficient, effective, or optimal. Additionally, commented code, while sometimes helpful in small examples, is not a sufficient explanation in and of itself. Your explanations and justifications are expected to be presented in prose and in paragraph format, i.e. not bulleted lists. Further, part of the evaluation of your report is the apparent amount of thought and effort that went into its creation.
This document should be divided into three main sections, and should follow the template provided on Canvas.
For the Project Description section, in one to two paragraphs you should describe the project in your own words and give a brief overview of the problem. Do not copy and paste this information from this instruction document.
For the Data Structure section, you should describe the data structures you used in your system. What objects or structs did you create to store data? How did you organize and manage them? What types of formal data structures did you make use of (trees, graphs, arrays, hashes, etc)? Be sure to put the majority of the functionality explanation in the System Functionality section. In a few paragraphs, describe in detail how you stored the various data elements in your system, and be sure to provide sufficient justification of your methodology.
For the System Functionality section, you should describe functionality of your system. How is data moved and transformed? How is it read in? How is it output? What are the various major functions you constructed and how do they work? In a few paragraphs, describe in detail how your system works, and be sure to provide sufficient justification of your methodology. You might also consider including diagrams to more easily visualize how all of the pieces fit together.
Implementation
Your program must provide the following functionality and adhere to the following constraints:
- Allow the user to input the name of the file containing the list of dishes:
- Do NOT hardcode the filename into your program.
- The first line will be a comma delimited list containing the full list of ingredients the restaurant has on hand.
- All other lines will have the name of the dish, followed by a colon, and then a comma delimited list of ingredients.
- Your program should read in each dish and create an appropriate set object for the dish.
- If a dish contains an ingredient that is not part of the full list of ingredients the restaurant has on hand, politely report this to the user and do not include the dish
- Your int main() should be in its own .cpp file
- The set class for a dish should be in its own .cpp file with an associated header file and contain at least:
- A bit vector representation of the dish's ingredients using Booleans.
- Appropriate accessor and mutator (getter and setter) member functions to promote encapsulation.
- Using appropriate set operations (i.e. Union, Intersection, etc) you implement as functions, your program should calculate and output the following:
- The set of all ingredients that are in one or more dishes in 0/1 format, where a 1 indicates an ingredient is a member of the set.
- The set of all ingredients that are in more than one dish in 0/1 format, where a 1 indicates an ingredient is a member of the set.
- The set of all ingredients that are in exactly one dish in 0/1 format, where a 1 indicates an ingredient is a member of the set.
- The set of all ingredients that are in no dishes in 0/1 format, where a 1 indicates an ingredient is a member of the set.
- These operations should be stored in a separate .cpp file as a library.
- Remember that most set operations are binary (performed on two sets), so your set operation functions should never be performed on more than two sets at a time. You may need a temporary set to store information while you are working toward the final solution.
- Manipulation and generation of resulting sets should only be performed using set operations
- Your program should also output the 0/1 formatted set of the ingredients for each dish, where a 1 indicates an ingredient is a member of the set. Make sure the name of the dish is provided along with its associated ingredients.
- Example outputs have been provided in the same directory as the example inputs.
- You may not use any of the set containers or set operations/algorithms provided by C or C++. You must write your own versions of them.
- Examples: bitsets, sets, multisets, set_union, set_intersection, set_difference, etc
- Your code must be well commented.
- You must provide a .txt README file which includes your name and explains how to compile and run your program. An example README file has been provided in the same directory as the example input files.
- Additionally, you may write a makefile if you want your code to compile with additional flags.