Question: Write a program that allows Marcia, an avid cook, to keep an inventory of her spices and herbs. These ingredients will be stored in a

Write a program that allows Marcia, an avid cook, to keep an inventory of her spices and herbs. These ingredients will be stored in a text file called pantry.txt. When your program is executed the ingredients from the data file will be stored in a dynamic array. A menu with the following options will then be displayed.

Table 12.20.1 Menu Options

Menu Option

Description

Add Ingredient

Prompt for and add an ingredient to the dynamic array.

Remove Ingredient

Remove a specific ingredient from the dynamic array.

Search for Ingredient

Search for the existence of a specific ingredient.

Edit Ingredient

Search for an ingredient and allow the user to change the spelling of a specific ingredient.

Save Ingredients to File

Write a dynamic array to pantry.txt, saving any changes.

Display Ingredients

Display all of the ingredients to the screen.

Check Recipe for Ingredients

Prompt for the filename of a recipe text file. Read the contents of the recipe file a line at a time and store it into a dynamic array. Then search for the existence of the spices and herbs that are currently stored in the dynamic arrays in the recipe. The ingredients in the recipe file are guaranteed to be surrounded by <>. Display any ingredients that are in the recipe file that arent found in the pantry.

Exit

Exit the program and save the changes to the pantry file.

A sample pantry.txt file is shown below.

Table 12.20.2 Pantry file

Basil

Flat Leaf Parsley

Thyme

Sage

Cumin

Steak Seasoning

Mace

Garlic Powder

Search the Internet for appropriate recipes. Modify the recipes to surround spices and herbs with < >. For example, a recipe using Basil will need to be modified so it appears as .

Any help would be great. My program won't run. I'm unable to post it here as it is too long. This is written in C++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!