2-2 Stepping Stone Lab One: Pseudocode for Your Program
IT-511 Object Oriented App Developent11/4/2019
The program for the final project is a collection manager program for culinary recipes. There will need to be three primary classes in the overall program: The first one will be for storing ingredients to store what items comprise a given recipe. The second will be for the actual recipes which will draw objects from the ingredients class as well as methods that are recipe specific.
The third class will be an array that will store recipes and their components. The user will be able to enter some information, such as the total number of calories in a recipe, but the program will handle other variables automatically. The Recipe Box will be the primary aspect which users will interact with and will contain the main function of the overall Java program. As such, it will present the following options: Add New Recipe, Add New Ingredient, View Recipe, View Ingredient Details, Print a list of all recipes in storage, Print a list of all ingredients in storage, Delete a recipe, Delete an Ingredient, Exit Program.
The pseudocode below will help to inform the overall flow of the program as the project develops. It has been broken up on a per section/function basis for readability:
DEFINE string nameOfIngredientDEFINE double numberOfCupsDEFINE double numberOfCaloriesPerIngredientDEFINE double totalIngredientCalories
DEFINE int totalNumberOfIngredientsDEFINE ingredientList as array
DEFINE recipeIngredients as an array list
DEFINE string recipeNameDEFINE int numOfServingsDEFINE double totalRecipeCaloriesRecipe Box
DEFINE recipeBox = recipeListDEFINE recipeList as an array list, void, no members
CALL function recipeBoxIF user selects Add New Recipe
GOTO function addNewRecipeELSE IF user selects Add New Ingredient
GOTO function addNewIngredientELSE IF user selects View Recipe
GOTO function viewRecipeELSE IF user selects View Ingredient Details
GOTO function viewIngredientDetailsELSE IF user selects Print Recipe List
GOTO function printRecipeListELSE IF user selects Print Ingredient List
GOTO function printIngredientListELSE IF user selects Delete a Recipe
GOTO function deleteRecipeELSE IF user selects Delete an Ingredient
GOTO function deleteIngredientELSE IF user selects Exit Program
CALL function addRecipeDEFINE scanner object for accepting user input
CALL function getRecipeNameCALL function getNumOfServingsCALL function getRecipeIngredientsDISPLAY all ingredients in program memory
CALL function totalRecipeCaloriesFOR each ingredient in the recipe
totalRecipeCalories = sum of totalIngredientCaloriesPRINT recipe to recipeList array
CALL function addIngredientCALL function getNameOfIngredientCALL function getNumberOfCupsCALL function getNumberOfCaloriesCALL function getTotalIngredientCaloriestotalIngredientCalories = numberOfCups * numberofCaloriesPerIngredientPRINT ingredient to ingredientListEND function
CALL function viewRecipePRINT a list of all recipe names
RETURN to the home screen of the program
CALL function viewIngredientDetailsPRINT a list of all ingredient names
PRINT the details of the selected ingredient
RETURN to the home screen of the program
CALL function printRecipeListPRINT recipeListIF user selects a specific recipe
ELSE IF return to the home screen of the program
CALL function printIngredientListPRINT ingredientListIF user selects an ingredient
ELSE IF return to the home screen of the program
CALL function deleteRecipePRINT list of all recipes
ELSE IF return to the home screen of the program
CALL function deleteIngredientPRINT list of all ingredients
CONFIRM they want to delete itIF Yes
ELSE IF return to the home screen of the program
Stepping Stone Lab One - Pseudocode for Your Program. (2019, Nov 29). Retrieved from https://paperap.com/stepping-stone-lab-one-pseudocode-for-your-program-best-essay/