Question: How would you go about writing some java code on these questions? It's mostly a lesson based on iterators and early exit while loops.... if
How would you go about writing some java code on these questions?

It's mostly a lesson based on iterators and early exit while loops.... if the questions are confusing, the original full post is here: https://www.chegg.com/homework-help/questions-and-answers/really-need-help-java-program-also-please-don-t-copy-paste-solution-another-question-happe-q25486775
If not, a pseudo code answer on how to write these methods would be appreciated.
Add a method named canMake to the Cookbook class. It should have two parameters a recipe, and a collection of ingredients that represents all the unique ingredients that represents all the food you have in your home (order does not matter). It should return true if you have enough of every ingredient required by the recipe. Otherwise, it should return false. (You may assume that no type of ingredient appears more than once in the parameter.) This may require using conversions. For example, suppose we get a recipe that requires 2 cups of sugar and 3 tablespoons of butter, and we have 5 cups of sugar and 1 stick of butter. We also have a conversion that 1 stick-8 table of sugar is at least 2 cups of sugar, and 1 stick of butter is the same as 8 tablespoons of butter, which is at least 3 tablespoons of butter spoons. We can make this recipe, because 5 cups Add a method named getMakeable to the Cookbook class. It should one parameter, a collection of unique ingredients that represents all the food you have in your home (order does not matter). It should return a collection of all recipes that you can make with those ingredients, in alphabetical order by recipe name Add a static method named getGroceryList to the Cookbook class. It should have one parameter, a collection of recipes that you intend to prepare during the week. It should return a collection of all the unique ingredients that will be needed to make those recipes (order does not matter). If two recipes require the same ingredient, with the same unit of measure, they should be combined For example, if you are making one recipe that requires 3 cups of sugar and another that requires 4 cups of sugar, your collection should contain one entry of 7 cups of sugar. However, if one recipe requires 3 cups of sugar and another requires 3 tablespoons of sugar, you can leave that as two different entries
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
