Question: Recipe Management System Objective Create a Recipe Management System to manage recipes, including ingredients and cooking instructions, utilizing object - oriented programming principles such as
Recipe Management System
Objective
Create a Recipe Management System to manage recipes, including ingredients and cooking instructions, utilizing objectoriented programming principles such as inheritance and constructor overloading. This system will handle adding, removing, and searching for recipes using advanced Java concepts.
Functional Requirements
Ingredient Class:
Purpose: Represents individual ingredients used in recipes.
Attributes:
String name The name of the ingredient.
String quantity The quantity of the ingredient required eg cup", grams"
Constructors:
Default constructor for initializing an ingredient with default values.
Parameterized constructor for initializing an ingredient with specified values.
Methods:
getName: Returns the name of the ingredient.
getQuantity: Returns the quantity of the ingredient.
setNameString name: Sets the name of the ingredient.
setQuantityString quantity: Sets the quantity of the ingredient.
Recipe Class:
Purpose: Represents a single recipe, including its name, ingredients, and cooking instructions.
Attributes:
String name The name of the recipe.
String ingredients Array holding ingredients required for the recipe.
String instructions Array holding stepbystep instructions for preparing the recipe.
Constructors:
Default constructor for initializing a recipe with default values.
Parameterized constructor for initializing a recipe with a specified name, ingredients, and instructions.
Methods:
getName: Returns the name of the recipe.
getIngredients: Returns the array of ingredients.
getInstructions: Returns the array of cooking instructions.
setNameString name: Sets the name of the recipe.
setIngredientsString ingredients: Sets the ingredients for the recipe.
setInstructionsString instructions: Sets the cooking instructions.
RecipeBook Class Inherits from Recipe:
Purpose: Manages a collection of recipes, allowing for operations such as adding, removing, and searching for recipes. Inherits from the Recipe class to extend its functionality.
Attributes:
Recipe recipes Array to store the recipes.
int recipeCount Tracks the number of recipes currently in the RecipeBook.
Constructors:
Default constructor for initializing an empty recipe book.
Parameterized constructor to initialize with a specified capacity for the recipe array.
Methods:
addRecipeRecipe recipe: Adds a new recipe to the RecipeBook.
removeRecipeString recipeName: Removes a recipe by its name.
findRecipeString recipeName: Searches for a recipe by its name and returns the Recipe object if found, otherwise returns null.
printRecipeRecipe recipe: Prints the details of a specific recipe.
printAllRecipes: Prints the details of all recipes in the RecipeBook.
Technical Implementation
Ingredient Class:
Implement constructor overloading by providing both a default and parameterized constructor to initialize ingredient objects.
Recipe Class:
Implement constructor overloading to provide flexibility in creating recipe objects with different levels of detail.
RecipeBook Class:
Inherit from Recipe to demonstrate basic inheritance.
Use constructor overloading to initialize the recipe book with or without a specified capacity.
Driver Details
Write a Driver method that will interact with the user through a consolebased menu system, allowing the user to perform various operations related to recipe management. The menu will offer options for adding, viewing, searching, and removing recipes, and will continue to prompt the user until they choose to exit. The options are:
Prompt the user to enter a recipe
Create a RecipeBook Instance
Define Example Ingredients and Instructions
Create and Add a Recipe
Print All Recipes
Find and Print a Specific Recipe
Remove a Recipe and Print Remaining Recipes
Submission Details
You need to submit the Java code java files and a MS Word document which includes the screenshots of the program to show each part is complete and tested.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
