Project Description
For this project, students are going to create a program that asks the user for a list of ingredients. As the user enters the ingredients, you should store them in a list. Once the user is done entering their list, you need to pass this list to a function that will compare the ingredients to an already existing list of pantry items.
Your Task
The Shopping List
For this problem, you are going to create a program that asks the user for a list of ingredients. As the user enters the ingredients, you should store them in a list.
Once the user is done entering their list, you need to pass this list to a function that will compare the ingredients to an already existing list of pantry items.
If all items are available in the pantry, print out that you don’t need to go shopping. If any item is missing, print out that you need to go shopping and list the ingredients.
While there is more than one way to complete this assignment, your answer must include the following:
- A pre-created list for pantry items
- User input into an ingredient list
- Pass the ingredient list to a method
- Use a conditional and loop in the method
- Print out the results of whether the user needs to go shopping based on the items in the ingredient list that are not in the pantry.
Sample Output #1:
Please enter an ingredient ('done' when complete): Bread
Please enter an ingredient ('done' when complete): Peanut Butter
Please enter an ingredient ('done' when complete): Chips
Please enter an ingredient ('done' when complete): Jelly
Please enter an ingredient ('done' when complete): done
You need to go shopping!
The following ingredients are missing:
Jelly
Sample Output #2:
Please enter an ingredient ('done' when complete): Bread
Please enter an ingredient ('done' when complete): Peanut Butter
Please enter an ingredient ('done' when complete): done
It looks like you have everything to make your recipe!