Software

profilespike34
UMLdiagramtopseudo-code.docx

UML Overview to pseudo-code

There are three classes in this program

This class contains the making of an ingredient and calculation of calories in the ingredient

Class Ingredient {

Contains

A string Variable for name of ingredient

A float variable for number of cups

An integer variable for number of calories per cup

A double variable for total calories

Function getNameOfIngredient()

{

This function gets the name of ingredient

Return name of ingredient

End

}

Function setNameOfIngredient(Argument NOI)

{

This function set the value of ingredient by taking the input from user

End

}

Function getnumberofcups()

{

This function gets the number of cups

Return number of cups

End

}

Function setNumberOfCups(Argument NOC)

{

This function takes the input from the user and set it to variable number of cups

End

}

Function NumberOfCaloriesPerCup()

{

This function gets the Number of Calories per Cup

Return Total Calories

End

}

Function NumberOfCaloriesPerCup(Argument NOI)

{

This function set the value of Number Of Calories Per Cup by taking the input from user

End

}

Function TotalCalories()

{

This function gets the Total Calories

Return Total Calories

End

}

Function TotalCalories(Argument NOI)

{

This function set the value of Total Calories by taking the input from user

End

}

Function AddIngredeint()

{

This function gets value for all the member variables and set them up to each of the member variable

End

}

End of Class

}

This class contains the information about recipe and how the recipe would be prepared

Class Recipe {

Contains

A string Variable for Recipe Name

A Integer variable for Servings

An Array List variable for Recipe Ingredients

A double variable for Total Recipe Calories

Function getRecipeName()

{

This function gets the Recipe Name

Return Recipe Name

End

}

Function setRecipeName (Argument RN)

{

This function set the value of Recipe Name by taking the input from user

End

}

Function getServings()

{

This function gets the number Servings

Return number of Servings

End

}

Function setServings (Argument Servings)

{

This function takes the input from the user and set it to variable number of Servings

End

}

Function getRecipeIngredients()

{

For loop runs until Arraylist

This function gets the Recipe Ingredients list

Return Recipe Ingredients

End

}

Function setRecipeIngredients (Argument RI)

{

For loop until Array List

This function set the value of Recipe Ingredients by taking the input from user

End

}

Function getTotalRecipeCalories()

{

This function gets the Total Recipe Calories

Return Total Recipe Calories

End

}

Function setTotalRecipeCalories (Argument TRC)

{

This function set the value of Total Recipe Calories by taking the input from user

End

}

Function PrintRecipe()

{

This function prints value for all the member variables

End

}

Function addNewRecipe()

{

This function sets all the member variables for the new class recipe

Return Recipe object

End

}

End of Class

}

This third Class contains the information for all recipes and details for the recipes

Class RecipeBox

{

Member variables List Of Recipe with Array List

Function getListOfRecipes()

{

For loop until ArrayList

This function gets the List of Recipes

Return List of Recipe

End

}

Function setListOfRecipe(Argument LOR)

{

For loop until Array List

This function set the value of List of Recipe by taking the input from user

End

}

Function RecipeBox()

{

This function gets the number of recipes in the class used by the restaurant.

End

}

Function RecipeBox(Argument Recipe)

{

This function sets the number of recipes in the class used by the restaurant.

End

}

Function PrintRecipeNames()

{

This function prints value for all the names of all the recipes

End

}

Function PrintallRecipedetails(Argument Recipes)

{

This function prints value for all the Details for Recipes

End

}

Function addNewRecipe()

{

This function sets all the member variables for the new class recipe

Return Recipe object

End

}

End of Class

}