Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 programimage text in transcribed

Example of output:

image text in transcribedpost screenshot of output

beans, 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 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

Describe the team dynamics at Facebook.

Answered: 1 week ago

Question

What about leadership lessons from particularly good or bad bosses?

Answered: 1 week ago