1. Engineering
  2. Computer Science
  3. write a program in c to help manage inventory for...

Question: write a program in c to help manage inventory for...

Question details

write a program in c++ to help manage inventory for a resturant. system will read in the list of ingredients for each dish, store ingredients list for each dish in a bit vector and perform data analytics on the information to help the resturant determine where it can make improvements.

the program must provide the following functionality:

-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

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.

Please do not use any of the set containers or set operations/algorithms provided by C or C++. such as: bitsets, sets, multisets, set_union, set_intersection, etc...

Examples of input file to programbeans, tomatoes, fish,eggs,milk, flour, sugar,yeast, cheese,salt,oil,onions,lemon cheese pizza:eggs,milk, flour,yeast, sugar,tomatoes,cheese baked fish:fish,lemon fried fish:fish,lemon,oil smoked fish:fish, smoke,lemon beans and fish:beans,fish,lemon

Example of output:

The dish smoked fish contains smoke which is not something we have. flour onions Dish Name cheese pizza: baked fish: fried fish: ans and fish: beans tomatoes fish eg8s milk sugar yeast chee salt oil lemon bea At Least One: More ThanOne: Exactly One: Not Used:post screenshot of output

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution