Question: Consider the following code: public class RecipeBook { private String name; private Map > recipes; public RecipeBook ( String name ) { this.name = name;
Consider the following code:
public class RecipeBook private String name; private Map recipes; public RecipeBookString name this.name name; this.recipes new HashMap; REQUIRES: recipeName is not already in recipes MODIFIES: this EFFECTS: adds recipeName to recipes, and assigns an empty list of ingredients public void addNewRecipeString recipeName List ingredients new ArrayList; BLANK REQUIRES: recipeName is in recipes MODIFIES: this EFFECTS: adds ingredient to recipeName's list of ingredients public void addToRecipeString recipeName, String ingredient List ingredients recipes.getrecipeName; BLANK public void printRecipes System.out.printlnthisrecipes; public class Main public static void mainString args RecipeBook grampasWings new RecipeBookGrampas Wings"; grampasWings.addNewRecipehot wings"; grampasWings.addToRecipehot wings", "wings"; grampasWings.addToRecipehot wings", "spices"; grampasWings.printRecipes;
Part
What goes in BLANK select all that apply:
Checkbox options
a
values.addingredients;
b
recipes.putrecipeNamenew ArrayList
c
values recipes.getrecipeName;
d
values recipes.getrecipeName;
e
recipes.addrecipeName
f
values ingredients;
g
recipes.putrecipeName ingredients
Select all possible options that apply.
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
